Elamur Research⌕
☰
home / papers / 2026 / GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMs

GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMs

Paper · 2026 · Duy Nguyen, Archiki Prasad, Elias Stengel-Eskin et al.

Summary

Inference-time steering adjusts a model's hidden activations instead of its weights, but most existing methods add one global vector to every token. They also derive that vector only from latent-space differences. This can over-correct the model and ignores which inputs actually cause unwanted outputs, a problem that is sharper in VLMs, where image and text tokens matter unequally. GrAInS addresses this in three steps:

  • It runs Integrated Gradients on a contrastive objective, the log-probability gap between a preferred and a dispreferred response, to find the top-k tokens (textual or visual) pushing the model in each direction.
  • It masks those token sets, records how the hidden states change, and uses PCA to build a separate steering vector for each layer.
  • At inference, it adds these vectors with normalization that keeps the activation scale intact.

The approach needs no object detector, no sampling and no learned auxiliary module. Across truthfulness, toxicity, hallucination and alignment benchmarks, it beats LoRA fine-tuning and earlier steering methods while leaving general capabilities almost unchanged. It also shows that attribution tools can be used to control models, not only to explain them.

Key points

  • On Llama-3.1-8B-Instruct, TruthfulQA accuracy rises by 13.22%, which is 7.7% above ICV. On Toxigen, accuracy improves by 9.89% over the base model and by 4.10% over NL-ITI.
  • On LLaVA-1.6-7B, the MMHal-Bench hallucination rate drops from 0.624 to 0.514. Preference win rate on SPA-VL improves by 8.11%, compared with 2.4% for prior methods in the paper's comparison.
  • General ability is preserved:
    • MMLU on Llama-3.1-8B falls by only 0.12% with GrAInS, versus 17.78% with CAA.
    • MMMU on Qwen2.5-VL-7B falls by 0.51% with GrAInS, versus 17.13% with CAA.
  • The vectors transfer across datasets:
    • A Toxigen vector also reduces toxicity on RealToxicityPrompts.
    • An MMHal-Bench vector reaches 84.06 accuracy on the POPE adversarial split, compared with 83.54 for VTI.
  • Attribution and vector building are a one-time cost per steering objective. Inference throughput drops by only about 3.6% on an RTX A6000, and the code is available at github.com/duykhuongnguyen/GrAInS.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Fields, topics and concepts

Cite

Cite as Duy Nguyen, Archiki Prasad, Elias Stengel-Eskin and Mohit Bansal. 2026. GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMs. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2026.acl-long.2159

@inproceedings{nguyen2026grains,
  title = {{GrAInS: Gradient-based Attribution for Inference-Time Steering of LLMs and VLMs}},
  author = {Duy Nguyen, Archiki Prasad, Elias Stengel-Eskin and Mohit Bansal},
  booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.2159},
  url = {https://doi.org/10.18653/v1/2026.acl-long.2159}
}

References

73 references, 20 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Chirag Agarwal, Nari Johnson, Martin Pawelczyk, Satyapriya Krishna, Eshika Saxena, Marinka Zitnik, and Himabindu Lakkaraju. 2022. Rethinking stability for attribution-based explanations. arXiv preprint arXiv:2203.06877. — [arXiv:2203.06877](https://arxiv.org/abs/2203.06877) find
  2. Sushant Agarwal, Shahin Jabbari, Chirag Agarwal, Sohini Upadhyay, Steven Wu, and Himabindu Lakkaraju. 2021. Towards the unification and robustness of perturbation and gradient based explanations. In International conference on machine learning, pages 110–119. PMLR. find
  3. Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. 2019. Gradient-based attribution methods. In Explainable AI: Interpreting, explaining and visualizing deep learning, pages 169–191. Springer. find
  4. Pepa Atanasova, Jakob Grue Simonsen, Christina Lioma, and Isabelle Augenstein. 2020. A diagnostic study of explainability techniques for text classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3256–3274, Online. Association for Co…
  5. Qiwei Bi, Jian Li, Lifeng Shang, Xin Jiang, Qun Liu, and Hanfang Yang. 2022. MTRec: Multi-task learning over BERT for news recommendation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2663–2669, Dublin, Ireland. Association for Computational Linguistics. find
  6. Jianjian Cao, Peng Ye, Shengze Li, Chong Yu, Yansong Tang, Jiwen Lu, and Tao Chen. 2024. Madtp: Multimodal alignment-guided dynamic token pruning for accelerating vision-language transformer. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 15710–15719. find
  7. Yapei Chang, Yekyung Kim, Michael Krumdick, Amir Zadeh, Chuan Li, Chris Tanner, and Mohit Iyyer. 2025. Bleuberi: Bleu is a surprisingly effective reward for instruction following. arXiv preprint arXiv:2505.11080. find
  8. Yurui Chang, Bochuan Cao, Yujia Wang, Jinghui Chen, and Lu Lin. 2024. Xprompt: Explaining large language model’s generation via joint prompt attribution. arXiv preprint arXiv:2405.20404. — [arXiv:2405.20404](https://arxiv.org/abs/2405.20404) find
  9. Junzhe Chen, Tianshu Zhang, Shiyu Huang, Yuwei Niu, Linfeng Zhang, Lijie Wen, and Xuming Hu. 2024a. Ict: Image-object cross-level trusted intervention for mitigating object hallucination in large vision-language models. Preprint, arXiv:2411.15268. — [arXiv:2411.15268](https://arxiv.org/abs/2411.15268) find
  10. Meiqi Chen, Yixin Cao, Yan Zhang, and Chaochao Lu. 2024b. Quantifying and mitigating unimodal biases in multimodal large language models: A causal perspective. arXiv preprint arXiv:2403.18346. find
  11. Qizhou Chen, Taolin Zhang, Chengyu Wang, Xiaofeng He, Dakan Wang, and Tingting Liu. 2025. Attribution analysis meets model editing: Advancing knowledge correction in vision language models with visedit. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, pages 2168–2176. find
  12. Ian C. Covert, Scott Lundberg, and Su-In Lee. 2021. Explaining by removing: a unified framework for model explanation. J. Mach. Learn. Res., 22(1). find
  13. Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, and 1 others. 2024. The llama 3 herd of models. arXiv preprint arXiv:2407.21783.
  14. Matteo Farina, Gianni Franchi, Giovanni Iacca, Massimiliano Mancini, and Elisa Ricci. 2024. Frustratingly easy test-time adaptation of vision-language models. In The Thirty-eighth Annual Conference on Neural Information Processing Systems. find
  15. Javier Ferrando, Gerard I. Gállego, Ioannis Tsiamas, and Marta R. Costa-jussà. 2023. Explaining how transformers use context to build predictions. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5486–5513, Toronto, Canada. Ass… find
  16. Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. 2020. RealToxicityPrompts: Evaluating neural toxic degeneration in language models. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3356–3369, Online. Association for Computational Linguisti…
  17. Soumya Suvra Ghosal, Souradip Chakraborty, Vaibhav Singh, Tianrui Guan, Mengdi Wang, Ahmad Beirami, Furong Huang, Alvaro Velasquez, Dinesh Manocha, and Amrit Singh Bedi. 2024. Immune: Improving safety against jailbreaks in multi-modal llms via inference-time alignment. arXiv preprint arXiv:2411.1868… — [arXiv:2411.18688](https://arxiv.org/abs/2411.18688) find
  18. Thomas Hartvigsen, Saadia Gabriel, Hamid Palangi, Maarten Sap, Dipankar Ray, and Ece Kamar. 2022. ToxiGen: A large-scale machine-generated dataset for adversarial and implicit hate speech detection. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1:…
  19. Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2021. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR).
  20. Jakub Hoscilowicz, Adam Wiacek, Jan Chojnacki, Adam Cieslak, Leszek Michon, and Artur Janicki. 2024. Non-linear inference time intervention: Improving llm truthfulness. In Proc. find
  21. Interspeech 2024, pages 4094–4098. find
  22. Edward J Hu, yelong shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations.
  23. Yue Huang, Lichao Sun, Haoran Wang, Siyuan Wu, Qihui Zhang, Yuan Li, Chujie Gao, Yixin Huang, Wenhan Lyu, Yixuan Zhang, Xiner Li, Hanchi Sun, Zhengliang Liu, Yixin Liu, Yijue Wang, Zhikun Zhang, Bertie Vidgen, Bhavya Kailkhura, Caiming Xiong, and 52 others. 2024. Trustllm: Trustworthiness in large l…
  24. Shawn Im and Yixuan Li. 2025. A unified understanding and evaluation of steering methods. arXiv preprint arXiv:2502.02716. — [arXiv:2502.02716](https://arxiv.org/abs/2502.02716) find
  25. Andrei Kapishnikov, Subhashini Venugopalan, Besim Avci, Ben Wedin, Michael Terry, and Tolga Bolukbasi. 2021. Guided integrated gradients: An adaptive path method for removing noise. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 5050–5058. find
  26. Pegah Khayatan, Mustafa Shukor, Jayneel Parekh, and Matthieu Cord. 2025. Analyzing fine-tuning representation shift for multimodal llms steering alignment. arXiv preprint arXiv:2501.03012. — [arXiv:2501.03012](https://arxiv.org/abs/2501.03012) find
  27. Sicong Leng, Hang Zhang, Guanzheng Chen, Xin Li, Shijian Lu, Chunyan Miao, and Lidong Bing. 2024. Mitigating object hallucinations in large vision-language models through visual contrastive decoding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13872–13…
  28. Junlong Li, Fan Zhou, Shichao Sun, Yikai Zhang, Hai Zhao, and Pengfei Liu. 2024a. Dissecting human and llm preferences. arXiv preprint arXiv:2402.11296. find
  29. Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. 2024b. Inference-time intervention: Eliciting truthful answers from a language model. Advances in Neural Information Processing Systems, 36.
  30. Yifan Li, Yifan Du, Kun Zhou, Jinpeng Wang, Wayne Xin Zhao, and Ji-Rong Wen. 2023. Evaluating object hallucination in large vision-language models. arXiv preprint arXiv:2305.10355.
  31. Zhizhong Li and Derek Hoiem. 2017. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947. find
  32. Stephanie Lin, Jacob Hilton, and Owain Evans. 2022. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3214–3252, Dublin, Ireland. Association for Computational Linguistics…
  33. Zihao Lin, Samyadeep Basu, Mohammad Beigi, Varun Manjunatha, Ryan A. Rossi, Zichao Wang, Yufan Zhou, Sriram Balasubramanian, Arman Zarei, Keivan Rezaei, Ying Shen, Barry Menglong Yao, Zhiyang Xu, Qin Liu, Yuxiang Zhang, Yan Sun, Shilong Liu, Li Shen, Hongxuan Li, and 2 others. 2025. A survey on mech… — [arXiv:2502.17516](https://arxiv.org/abs/2502.17516) find
  34. Haotian Liu, Chunyuan Li, Yuheng Li, Bo Li, Yuanhan Zhang, Sheng Shen, and Yong Jae Lee. 2024a. Llava-next: Improved reasoning, ocr, and world knowledge. find
  35. Sheng Liu, Haotian Ye, Lei Xing, and James Zou. 2024b. Reducing hallucinations in vision-language models via latent space steering. arXiv preprint arXiv:2410.15778. — [arXiv:2410.15778](https://arxiv.org/abs/2410.15778) find
  36. Sheng Liu, Haotian Ye, Lei Xing, and James Y Zou. 2024c. In-context vectors: Making in context learning more effective and controllable through latent space steering. In Forty-first International Conference on Machine Learning. find
  37. Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. 2024. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36.
  38. David Lopez-Paz and Marc’Aurelio Ranzato. 2017. Gradient episodic memory for continual learning. Advances in neural information processing systems, 30. find
  39. Scott M Lundberg and Su-In Lee. 2017. A unified approach to interpreting model predictions. Advances in neural information processing systems, 30.
  40. Alexandre Rame, Guillaume Couairon, Corentin Dancette, Jean-Baptiste Gaya, Mustafa Shukor, Laure Soulier, and Matthieu Cord. 2024. Rewarded soups: towards pareto-optimal alignment by interpolating weights fine-tuned on diverse rewards. Advances in Neural Information Processing Systems, 36. find
  41. Samuel Marks and Max Tegmark. 2023. The geometry of truth: Emergent linear structure in large language model representations of true/false datasets. arXiv preprint arXiv:2310.06824.
  42. Sukrut Rao, Moritz Böhle, and Bernt Schiele. 2022. Towards better understanding attribution methods. In Proceedings of the ieee/cvf conference on computer vision and pattern recognition, pages 10223–10232. find
  43. Yifei Ming, Senthil Purushwalkam, Shrey Pandit, Zixuan Ke, Xuan-Phi Nguyen, Caiming Xiong, and Shafiq Joty. 2025. Faitheval: Can your language model stay faithful to context, even if ”the moon is made of marshmallows”. In The Thirteenth International Conference on Learning Representations. find
  44. Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, and Alexander Turner. 2024. Steering llama 2 via contrastive activation addition. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15504–15522, Bangkok, Thaila… find
  45. Bao Nguyen, Binh Nguyen, Duy Nguyen, and Viet Anh Nguyen. 2025a. Risk-aware distributional intervention policies for language models. arXiv preprint arXiv:2501.15758. — [arXiv:2501.15758](https://arxiv.org/abs/2501.15758) find
  46. Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, and Alexander Matt Turner. 2023. Steering llama 2 via contrastive activation addition. arXiv preprint arXiv:2312.06681. find
  47. Duy Nguyen, Archiki Prasad, Elias Stengel-Eskin, and Mohit Bansal. 2025b. Multi-attribute steering of language models via targeted intervention. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 20619–20634, Vienna, Austria. Ass…
  48. Yao Rong, Tobias Leemann, Vadim Borisov, Gjergji Kasneci, and Enkelejda Kasneci. 2022. A consistent and efficient evaluation strategy for attribution methods. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 18770–… find
  49. Nina Panickssery, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, and Alexander Matt Turner. 2023. Steering llama 2 via contrastive activation addition. arXiv preprint arXiv:2312.06681. find
  50. Emmanuelle Salin, Badreddine Farah, Stéphane Ayache, and Benoit Favre. 2022. Are vision-language transformers learning multimodal representations? a probing perspective. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 11248–11257. find
  51. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pages 311–318.
  52. Pouya Pezeshkpour, Sarthak Jain, Sameer Singh, and Byron Wallace. 2022. Combining feature and instance attribution to detect artifacts. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1934–1946, Dublin, Ireland. Association for Computational Linguistics. find
  53. Van-Cuong Pham and Thien Huu Nguyen. 2024. Householder pseudo-rotation: A novel approach to activation editing in LLMs with direction-magnitude perspective. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 13737–13751, Miami, Florida, USA. Association… find
  54. Ruizhe Shi, Yifang Chen, Yushi Hu, Alisa Liu, Hannaneh Hajishirzi, Noah A. Smith, and Simon Shaolei Du. 2024. Decoding-time language model alignment with multiple objectives. In ICML 2024 Workshop on Theoretical Foundations of Foundation Models. find
  55. Anushka Sivakumar, Andrew Zhang, Zaber Ibn Abdul Hakim, and Chris Thomas. 2025. SteerVLM: Robust model control through lightweight activation steering for vision language models. In Findings of the Association for Computational Linguistics: EMNLP 2025. Association for Computational Linguistics. find
  56. Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. 2017. Smoothgrad: removing noise by adding noise. Preprint, arXiv:1706.03825. — [arXiv:1706.03825](https://arxiv.org/abs/1706.03825) find
  57. Manogna Sreenivas and Soma Biswas. 2025. Efficient open-set test time adaptation of vision language models. In First Workshop on Scalable Optimization for Efficient and Adaptive Foundation Models. find
  58. Yizheng Sun, Yanze Xin, Hao Li, Jingyuan Sun, Chenghua Lin, and Riza Batista-Navarro. 2025. LVPruning: An effective yet simple language-guided vision token pruning approach for multi-modal large language models. In Findings of the Association for Computational Linguistics: NAACL 2025, pages 4299–430… find
  59. Zhiqing Sun, Sheng Shen, Shengcao Cao, Haotian Liu, Chunyuan Li, Yikang Shen, Chuang Gan, Liang-Yan Gui, Yu-Xiong Wang, Yiming Yang, and 1 others. 2023. Aligning large multimodal models with factually augmented rlhf. arXiv preprint arXiv:2309.14525.
  60. Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3319–3328. PMLR. find
  61. Gemma Team and 1 others. 2025. Gemma 3 technical report. Preprint, arXiv:2503.19786. find
  62. Qwen Team. 2024. Qwen2.5: A party of foundation models. find
  63. Alexander Matt Turner, Lisa Thiergart, Gavin Leech, David Udell, Juan J. Vazquez, Ulisse Mini, and Monte MacDiarmid. 2024. Steering language models with activation engineering. Preprint, arXiv:2308.10248.
  64. David Wan, Jaemin Cho, Elias Stengel-Eskin, and Mohit Bansal. 2024. Contrastive region guidance: Improving grounding in vision-language models without training. In European Conference on Computer Vision, pages 198–215. Springer. find
  65. Yongjie Wang, Tong Zhang, Xu Guo, and Zhiqi Shen. 2024. Gradient based feature attribution in explainable ai: A technical review. arXiv preprint arXiv:2403.10415. — [arXiv:2403.10415](https://arxiv.org/abs/2403.10415) find
  66. Junfei Wu, Yue Ding, Guofan Liu, Tianze Xia, Ziyue Huang, Dianbo Sui, Qiang Liu, Shu Wu, Liang Wang, and Tieniu Tan. 2025. SHARP: Steering hallucination in LVLMs via representation engineering. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing. Association for… find
  67. Mitigating object hallucinations in large vision-language models via halluspace projection. Preprint, arXiv:2412.13817. — [arXiv:2412.13817](https://arxiv.org/abs/2412.13817) find
  68. Kayo Yin and Graham Neubig. 2022. Interpreting language models with contrastive explanations. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 184–198, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. find
  69. Xiang Yue, Yuansheng Ni, Kai Zhang, Tianyu Zheng, Ruoqi Liu, Ge Zhang, Samuel Stevens, Dongfu Jiang, Weiming Ren, Yuxuan Sun, Cong Wei, Botao Yu, Ruibin Yuan, Renliang Sun, Ming Yin, Boyuan Zheng, Zhenzhu Yang, Yibo Liu, Wenhao Huang, and 3 others. 2024. Mmmu: A massive multi-discipline multimodal u…
  70. Yongting Zhang, Lu Chen, Guodong Zheng, Yifeng Gao, Rui Zheng, Jinlan Fu, Zhenfei Yin, Senjie Jin, Yu Qiao, Xuanjing Huang, Feng Zhao, Tao Gui, and Jing Shao. 2025. Spa-vl: A comprehensive safety preference alignment dataset for vision language model. Preprint, arXiv:2406.12030. — [arXiv:2406.12030](https://arxiv.org/abs/2406.12030) find
  71. Lihua Zhou, Mao Ye, Shuaifeng Li, Nianxin Li, Xiatian Zhu, Lei Deng, Hongbin Liu, and Zhen Lei. 2025. Bayesian test-time adaptation for vision-language models. Preprint, arXiv:2503.09248. — [arXiv:2503.09248](https://arxiv.org/abs/2503.09248) find
  72. Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xuwang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, and 1 others. 2023. Representation engineering: A top-down approach to ai transparency. arXiv preprint arXiv:2310.01405.
  73. Zhengtao Zou, Ya Gao, Jiarui Guan, Bin Li, and Pekka Marttinen. 2025. Adaptive residual-update steering for low-overhead hallucination mitigation in large vision language models. arXiv preprint arXiv:2511.10292. — [arXiv:2511.10292](https://arxiv.org/abs/2511.10292) find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/nguyen-2026-grains-gradient-based-attribution-inference/