When Explanations Cannot Be Read: Measuring and Correcting SHAP and LIME Rendering for Right-to-Left Languages

arXiv cs.LG Papers

Summary

The study introduces SHAP-RTL, a rendering layer that corrects the visualization of SHAP and LIME explanations for right-to-left languages, addressing issues like token sequence and script shaping while preserving original attribution values.

arXiv:2609.28565v1 Announce Type: new Abstract: Post hoc explanation methods such as SHAP and LIME are widely used to interpret text classifiers, but their visualizations are mainly designed for left-to-right languages. When applied to right-to-left (RTL) languages such as Urdu, Arabic, Persian, and Hebrew, the attribution values remain mathematically valid, while their visual presentation fails. Tokens appear out of sequence, connected letterforms break apart, and plot layouts do not follow the natural reading direction. This study addresses this gap as a visualization problem rather than a limitation of the explanation methods themselves. We present SHAP-RTL, a rendering layer that corrects reading direction and script shaping in SHAP and LIME visualizations, with per-language font selection, while preserving the original attribution values, feature ordering, and model outputs. The approach is evaluated on Urdu, Arabic, Hebrew, and Persian hate and offensive-language datasets using TF-IDF and logistic regression classifiers. Rendering correctness is measured by an OCR round trip over 200 feature words per language. Default rendering yields character error rates of 0.820 to 0.979, meaning the label no longer carries its token; the common reshape-and-reorder workaround fails for Urdu at 0.998, worse than no correction; and the Matplotlib 3.11.0 text rewrite inverts that workaround, while SHAP-RTL remains correct under both versions. The framework also verbalizes the same attributions as short contextual explanations in the reader's language, constrained to the identified features. Evaluation in this paper concerns rendering correctness; assessment of the generated explanations is left to future work. The study highlights the importance of language-aware visualization in making post hoc explainability more accessible across different writing systems.
Original Article
View Cached Full Text

Cached at: 09/25/26, 09:28 AM

# When Explanations Cannot Be Read: Measuring and Correcting SHAP and LIME Rendering for Right-to-Left Languages
Source: [https://arxiv.org/abs/2609.28565](https://arxiv.org/abs/2609.28565)
[View PDF](https://arxiv.org/pdf/2609.28565)

> Abstract:Post hoc explanation methods such as SHAP and LIME are widely used to interpret text classifiers, but their visualizations are mainly designed for left\-to\-right languages\. When applied to right\-to\-left \(RTL\) languages such as Urdu, Arabic, Persian, and Hebrew, the attribution values remain mathematically valid, while their visual presentation fails\. Tokens appear out of sequence, connected letterforms break apart, and plot layouts do not follow the natural reading direction\. This study addresses this gap as a visualization problem rather than a limitation of the explanation methods themselves\. We present SHAP\-RTL, a rendering layer that corrects reading direction and script shaping in SHAP and LIME visualizations, with per\-language font selection, while preserving the original attribution values, feature ordering, and model outputs\. The approach is evaluated on Urdu, Arabic, Hebrew, and Persian hate and offensive\-language datasets using TF\-IDF and logistic regression classifiers\. Rendering correctness is measured by an OCR round trip over 200 feature words per language\. Default rendering yields character error rates of 0\.820 to 0\.979, meaning the label no longer carries its token; the common reshape\-and\-reorder workaround fails for Urdu at 0\.998, worse than no correction; and the Matplotlib 3\.11\.0 text rewrite inverts that workaround, while SHAP\-RTL remains correct under both versions\. The framework also verbalizes the same attributions as short contextual explanations in the reader's language, constrained to the identified features\. Evaluation in this paper concerns rendering correctness; assessment of the generated explanations is left to future work\. The study highlights the importance of language\-aware visualization in making post hoc explainability more accessible across different writing systems\.

## Submission history

From: Muhammad Shahid Iqbal Malik Dr\. \[[view email](https://arxiv.org/show-email/72929c92/2609.28565)\] **\[v1\]**Wed, 23 Sep 2026 11:04:09 UTC \(810 KB\)

Similar Articles

RelShap: Relationally Consistent Shapley Explanations

arXiv cs.LG

This paper proposes RelShap, a framework that incorporates relational constraints and data provenance into Shapley value computation, making explanations more faithful to the data-generating process. It is estimator-agnostic and composes with existing SHAP estimators while exploiting functional dependencies to reduce runtime.

Applied Explainability for Large Language Models: A Comparative Study

arXiv cs.CL

A comparative study evaluating three explainability techniques (Integrated Gradients, Attention Rollout, SHAP) on fine-tuned DistilBERT for sentiment classification, highlighting trade-offs between gradient-based, attention-based, and model-agnostic approaches for LLM interpretability.

Language Shapes Instruction Hierarchy Compliance in Multilingual LLMs

arXiv cs.CL

This paper introduces XIH-Bench, a benchmark for evaluating instruction hierarchy compliance in multilingual LLMs, revealing language-dependent asymmetry and a Language Boundary Effect where cross-language conflicts yield higher compliance than same-language ones.