Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M³TrustEval-XQuAD

A multilingual trustworthiness evaluation framework for comparing direct generation with a modular Generator → Verifier → Reviser pipeline on parallel XQuAD question-answering data.

The project evaluates not only answer accuracy, but also evidence grounding, explanation faithfulness, multilingual performance disparity, and cross-lingual consistency using a single instruction-tuned language model.

Overview

Multilingual language models can achieve strong average performance while behaving inconsistently across languages or producing explanations that are insufficiently grounded in the provided context.

This project evaluates these issues using parallel XQuAD examples in five languages:

  • English (en)
  • Arabic (ar)
  • German (de)
  • Spanish (es)
  • Turkish (tr)

Two inference strategies are compared:

Direct Baseline

The model receives a context and question and directly produces:

  • Answer
  • Explanation
  • Supporting evidence
  • Confidence score

Modular Pipeline

The same initial answer is passed through an explicit verification workflow:

Question + Context
        │
        ▼
    Generator
        │
        ▼
     Verifier
      /     \
Supported   Unsupported
   │             │
   │             ▼
   │          Reviser
   │             │
   └──────┬──────┘
          ▼
     Final Answer

The verifier determines whether the proposed answer is sufficiently supported by the context. Unsupported answers are sent to the reviser for correction.

The same underlying model is used throughout the pipeline to keep the comparison controlled.


Model and Dataset

Language Model

Qwen/Qwen2.5-0.5B-Instruct

Dataset

google/xquad

XQuAD contains parallel translations of question-answering examples across multiple languages. The evaluation keeps question IDs shared across all selected languages, enabling controlled cross-lingual comparison.

The experiments use:

  • 150 aligned question IDs
  • 5 languages
  • 750 language-question pairs

Evaluation Metrics

Answer Quality

  • Exact Match — normalized exact agreement with the gold answer
  • Token F1 — token-level overlap with the gold answer
  • Fuzzy Match — approximate normalized string similarity

Grounding and Faithfulness

  • Evidence-in-Context — whether generated evidence approximately appears in the source context
  • Answer-in-Explanation — whether the generated explanation explicitly contains the predicted answer
  • Faithfulness — combined evidence and explanation grounding score

Multilingual Reliability

  • Per-language performance
  • English vs. non-English performance gap
  • Best- vs. worst-language gap
  • Standard deviation across languages
  • Worst-language performance
  • Cross-lingual consistency across parallel questions

Key Results

Overall Direct vs. Modular Performance

Metric Direct Modular
Exact Match 0.355 0.371
Token F1 0.454 0.471
Fuzzy Match 0.568 0.585
Faithfulness 0.674 0.767
Evidence Rate 0.824 0.848
Answer-in-Explanation 0.524 0.685

The modular pipeline produces modest improvements in answer quality, while the strongest gains appear in trustworthiness-related metrics.

Faithfulness increases from 0.674 to 0.767, and Answer-in-Explanation increases from 0.524 to 0.685.


Multilingual Findings

Performance differs substantially across languages.

English is generally the strongest language, while Turkish is the weakest language for several answer-quality metrics.

In the modular configuration:

  • English Exact Match: 0.493
  • Turkish Exact Match: 0.280

The effect of modular verification is not uniform across languages. Exact Match improves for Arabic, English, Spanish, and Turkish, while German decreases slightly.

The English vs. non-English Exact Match gap changes from:

Direct:   0.157
Modular:  0.153

Evidence-grounding disparity decreases more noticeably:

Direct:   0.112
Modular:  0.090

These results suggest that modular verification can reduce some forms of multilingual grounding disparity, although substantial language-dependent differences remain.


Cross-Lingual Consistency

Because the same semantic questions appear across multiple languages, the project also evaluates whether correctness remains stable across translations.

Mode Mean Consistency Fully Consistent Rate
Direct 0.816 0.360
Modular 0.805 0.347

The modular pipeline improves several aggregate quality and faithfulness metrics but does not improve cross-lingual consistency.

This distinction is important: better average performance does not necessarily imply more stable behavior across languages.


Visual Results

Token F1 by Language

Token F1 by Language and Mode

Faithfulness by Language

Faithfulness by Language and Mode

Best-vs.-Worst Language Gap

Best vs Worst Language Gap

Standard Deviation Across Languages

Language Performance Standard Deviation

Cross-Lingual Consistency

Cross-Lingual Consistency


Repository Structure

multilingual-llm-trust-evaluation/
├── assets/
│   ├── 01_token_f1_by_language_and_mode.png
│   ├── 02_faithfulness_by_language_and_mode.png
│   ├── 03_language_disparity_best_vs_worst_gap.png
│   ├── 04_language_disparity_standard_deviation.png
│   └── 05_cross_lingual_consistency_by_mode.png
├── multilingual_evaluation/
│   └── multilingual_trust_evaluation.ipynb
├── reports/
│   └── final_report.md
├── results/
│   ├── 01_direct_results.csv
│   ├── 02_modular_results.csv
│   ├── 03_combined_results.csv
│   ├── 04_aggregate_results.csv
│   ├── 05_aggregate_by_mode.csv
│   ├── 06_language_fairness_metrics.csv
│   ├── 07_best_worst_language_gap_compact.csv
│   ├── 08_standard_deviation_across_languages.csv
│   ├── 09_worst_language_compact.csv
│   ├── 10_cross_lingual_consistency_by_question_id.csv
│   └── 11_cross_lingual_consistency_summary.csv
├── .gitignore
├── README.md
└── requirements.txt

Installation

Clone the repository and install the dependencies:

git clone https://github.com/Hamidreza-Talei/multilingual-llm-trust-evaluation.git
cd multilingual-llm-trust-evaluation
pip install -r requirements.txt

A CUDA-capable GPU is recommended for faster inference.


Running the Evaluation

Open:

multilingual_evaluation/multilingual_trust_evaluation.ipynb

and execute the notebook sequentially.

The workflow:

  1. Loads aligned multilingual XQuAD examples.
  2. Loads Qwen2.5-0.5B-Instruct.
  3. Runs the direct QA baseline.
  4. Runs the Generator–Verifier–Reviser pipeline.
  5. Computes answer-quality and faithfulness metrics.
  6. Aggregates results by language and inference mode.
  7. Measures multilingual performance disparity.
  8. Computes cross-lingual consistency.
  9. Generates evaluation visualizations.
  10. Exports evaluation artifacts to results/.

Main Findings

The experiments highlight several important properties of multilingual LLM evaluation:

  • Modular verification improves overall answer quality, but the gains are relatively modest.
  • Improvements in faithfulness and explanation grounding are considerably stronger than improvements in accuracy.
  • English remains substantially stronger than several non-English languages.
  • Turkish is particularly challenging for answer-quality metrics.
  • Modular verification reduces some grounding-related language disparities.
  • Improvements are not uniform across every language and metric.
  • Better aggregate performance does not guarantee better cross-lingual consistency.
  • Using the same model as generator, verifier, and reviser limits verifier independence.

Overall, the results demonstrate why multilingual LLM evaluation should consider more than average accuracy alone.


Limitations

Several limitations should be considered when interpreting the results:

  • The same model acts as generator, verifier, and reviser, creating a risk of self-confirmation.
  • Qwen2.5-0.5B-Instruct is relatively small and may have limited multilingual reasoning and verification capacity.
  • The faithfulness metrics are automatic approximations rather than complete semantic-grounding measures.
  • The evaluation covers five languages rather than the full multilingual XQuAD collection.
  • The modular architecture requires additional model calls and therefore increases inference cost.
  • The experiments rely on automatic evaluation without human assessment of explanation quality.

Potential extensions include independent verifier models, larger multilingual models, additional languages, semantic faithfulness metrics, human evaluation, statistical significance testing, and component-level ablation studies.


Detailed Report

A more detailed discussion of the experimental results, multilingual disparities, limitations, and possible extensions is available in:

reports/final_report.md


References


Technologies

Python · PyTorch · Hugging Face Transformers · Hugging Face Datasets · Qwen2.5 · XQuAD · Pandas · NumPy · RapidFuzz · Matplotlib

About

Multilingual LLM trustworthiness evaluation on XQuAD, comparing direct generation with a generator-verifier-reviser pipeline across accuracy, faithfulness, language disparity, and cross-lingual consistency.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages