Context Engineering for Trustworthiness: Rescorla Wagner Steering Under
  Mixed and Inappropriate Contexts
Incorporating external context can significantly enhance the response quality
of Large Language Models (LLMs). However, real-world contexts often mix
relevant information with disproportionate inappropriate content, posing
reliability risks. How do LLMs process and prioritize mixed context? To study
this, we introduce the Poisoned Context Testbed, pairing queries with
real-world contexts containing relevant and inappropriate content. Inspired by
associative learning in animals, we adapt the Rescorla-Wagner (RW) model from
neuroscience to quantify how competing contextual signals influence LLM
outputs. Our adapted model reveals a consistent behavioral pattern: LLMs
exhibit a strong tendency to incorporate information that is less prevalent in
the context. This susceptibility is harmful in real-world settings, where small
amounts of inappropriate content can substantially degrade response quality.
Empirical evaluations on our testbed further confirm this vulnerability. To
tackle this, we introduce RW-Steering, a two-stage finetuning-based approach
that enables the model to internally identify and ignore inappropriate signals.
Unlike prior methods that rely on extensive supervision across diverse context
mixtures, RW-Steering generalizes robustly across varying proportions of
inappropriate content. Experiments show that our best fine-tuned model improves
response quality by 39.8% and reverses the undesirable behavior curve,
establishing RW-Steering as a robust, generalizable context engineering
solution for improving LLM safety in real-world use.
68c7862dee0eed1697d6b724
Rushi Wang
claimed_verified
2025-09-15T15:06:41.792Z
67919aac2502cd4a62674eb7
https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/_z4YwWFM2ATXjt27dfwAW.png
Rushi Wang
user
Rushi2002
68c7862dee0eed1697d6b725
Jiateng Liu
68c7862dee0eed1697d6b726
Cheng Qian
68c7862dee0eed1697d6b727
Yifan Shen
claimed_verified
2025-09-18T13:27:44.269Z
65e387095132c2edd193ae49
/avatars/39278e5b026bcbdde88c560fc54018c5.svg
Yifan Shen
user
SivanSX
68c7862dee0eed1697d6b728
Yanzhou Pan
68c7862dee0eed1697d6b729
Zhaozhuo Xu
68c7862dee0eed1697d6b72a
Ahmed Abbasi
68c7862dee0eed1697d6b72b
Heng Ji
68c7862dee0eed1697d6b72c
Denghui Zhang
Context Engineering for Trustworthiness: Rescorla Wagner Steering Under
  Mixed and Inappropriate Contexts
Incorporating external context can significantly enhance the response quality
of Large Language Models (LLMs). However, real-world contexts often mix
relevant information with disproportionate inappropriate content, posing
reliability risks. How do LLMs process and prioritize mixed context? To study
this, we introduce the Poisoned Context Testbed, pairing queries with
real-world contexts containing relevant and inappropriate content. Inspired by
associative learning in animals, we adapt the Rescorla-Wagner (RW) model from
neuroscience to quantify how competing contextual signals influence LLM
outputs. Our adapted model reveals a consistent behavioral pattern: LLMs
exhibit a strong tendency to incorporate information that is less prevalent in
the context. This susceptibility is harmful in real-world settings, where small
amounts of inappropriate content can substantially degrade response quality.
Empirical evaluations on our testbed further confirm this vulnerability. To
tackle this, we introduce RW-Steering, a two-stage finetuning-based approach
that enables the model to internally identify and ignore inappropriate signals.
Unlike prior methods that rely on extensive supervision across diverse context
mixtures, RW-Steering generalizes robustly across varying proportions of
inappropriate content. Experiments show that our best fine-tuned model improves
response quality by 39.8% and reverses the undesirable behavior curve,
establishing RW-Steering as a robust, generalizable context engineering
solution for improving LLM safety in real-world use.
LLMs process mixed contexts by prioritizing less prevalent information, which can degrade response quality; RW-Steering, a two-stage fine-tuning approach, improves LLM safety by identifying and ignoring inappropriate signals.
Large Language Models Poisoned Context Testbed Rescorla-Wagner model associative learning RW-Steering fine-tuning context engineering LLM safety