From Exposure to Internalization: Dual-Stream Calibration for In-context Clinical Reasoning
Authors: Chuang Zhao, Hongke Zhao, Xiaofang Zhou, Xiaomeng Li
Organizations: Department of Electronic and Computer Engineering, The Hong Kong University of Science and Technology, Hong Kong, SAR, China · College of Management and Economics, Laboratory of Computation and Analytics of Complex Management Systems (CACMS), Tianjin University, Tianjin 30072, China · Department of Computer Science and Engineering, The Hong Kong University of Science and Technology, Hong Kong, SAR, China
Contextual clinical reasoning demands robust inference grounded in complex, heterogeneous clinical records. While state-of-the-art fine-tuning, in-context learning (ICL), and retrieval-augmented generation (RAG) enable knowledge exposure, they often fall short of genuine contextual internalization: dynamically adjusting a model's internal representations to the subtle nuances of individual cases at inference time. To address this, we propose Dual-Stream Calibration (DSC), a test-time training framework that transcends superficial knowledge exposure to achieve deep internalization during inference. DSC facilitates input internalization by synergistically aligning two calibration streams. Unlike passive context exposure, the Semantic Calibration Stream enforces a deliberative reflection on core evidence, internalizing semantic anchors by minimizing entropy to stabilize generative trajectories. Simultaneously, the Structural Calibration Stream assimilates latent inferential dependencies through an iterative meta-learning objective. By training on specialized support sets at test-time, this stream enables the model to bridge the gap between external evidence and internal logic, synthesizing fragmented data into a coherent response. Our approach shifts the reasoning paradigm from passive attention-based matching to an active refinement of the latent inferential space. Validated against thirteen clinical datasets, DSC demonstrates superiority across three distinct task paradigms, consistently outstripping state-of-the-art baselines ranging from training-dependent models to test-time learning frameworks.
Figures & tables
Fig. 1: Motivations. Fig. 1(a) presents the ROUGE-L scores of various models evaluated on auxiliary QA pairs per sample. These QA pairs are generated from the eLife dataset’s context using DeepSeek-V3 [ 6 ] and subsequently provided as input for model evaluation. Qwen [ 7 ] and Lingshu [ 8 ] denote different LLM backbones. Fig. 1(b) depicts the predictive entropy fluctuations during the generative process. Fig. 1(c) evaluates model resilience (ROUGE-L) to contextual order on the eLife dataset, where the order of in-context demonstrations is randomly perturbed.
Fig. 2: Key difference between ICL, RAG, TTL-based baselines, and the proposed DSC. Our core innovation introduces a dual-calibration framework that enforces semantic understanding and structure robustness, transforming passive information retrieval into active contextual internalization.
Fig. 3: Overview of our DSC framework. The overall architecture of DSC is presented in (a), which outlines the comprehensive test-time training pipeline, while (b) provides a granular decomposition of our core dual-stream mechanism. DSC leverages two parallel streams to simultaneously refine the input from both semantic and structural dimensions. The Semantic Calibration Stream implements dynamic entropy detection and elimination. This process first localizes high-uncertainty tokens via long-short window entropy analysis and subsequently optimizes the model using dual objectives: an entropy loss to resolve ambiguity and a high-fidelity loss to preserve critical information, resulting in a semantically certain input representation. The Structure Calibration Stream runs in parallel to reconstruct the vital inferential links bridging the context and the clinical query. It employs an iterative, alternating framework where specialized support sets and meta-queries are dynamically synthesized for meta-optimization. Finally, (c) illustrates the test-time inference phase, where the model executes the final predictions using the parameters optimized specifically for the given query. θ∗ denotes the LLM parameters integrated with δ .
Methods
MedQA
PubMedQA
MedMCQA
MedBullets
MMLU
MMLU-Pro
MedExQA
Qwen2.5-7B [ 7 ]
0.160
0.160
0.240
0.045
0.127
0.260
0.090
Deepseek-R1-7B [ 6 ]
0.180
0.230
0.260
0.134
0.260
0.100
0.210
Lingshu-7B [ 8 ]
0.190
0.170
0.260
0.157
0.273
0.210
0.210
SFT [ 9 ]
0.210
0.180
0.080
0.184
0.260
0.180
0.160
GRPO [ 11 ]
0.230
0.240
0.230
0.134
0.150
0.180
0.180
ICL [ 17 ]
0.230
0.190
0.200
0.168
0.219
0.250
0.150
TABLE II: Performance comparison: Examination QA (HARD VERSION [ 33 ] ). The pipeline integrates Qwen2.5-7B [ 7 ] (LLM backbone), with further variations explored in Section V-B .
Methods
Cochrane
eLife
PLOS
Metrics
ROUGE-1
ROUGE-L
SARI
ROUGE-1
ROUGE-L
SARI
ROUGE-1
ROUGE-L
SARI
Qwen2.5-7B [ 7 ]
0.397
0.372
0.384
0.350
0.322
0.433
0.370
0.348
0.394
Deepseek-R1-7B [ 6 ]
0.400
0.369
0.383
0.368
0.349
0.437
0.410
0.372
0.367
Lingshu-7B [ 8 ]
0.385
0.357
0.383
0.312
0.291
0.428
0.357
0.329
0.384
SFT [ 9 ]
0.435
0.400
0.382
0.423
0.409
0.405
0.415
0.371
0.396
GRPO [ 11 ]
0.410
0.380
0.389
0.405
0.382
0.443
0.409
0.387
0.397
TABLE III: Performance comparison: Lay Summarization. In this task, we follow [ 24 ] .
TABLE V: Ablation Study. -NC ablates the retrieved context C ; -NSW/-NLW ablate the short/long entropy windows detection using fixed threshold, respectively; -NR ablates the Lrcf regularization term; -NS ablates the entire Semantic Calibration Stream; and -NST ablates the Structure Calibration Stream.
Fig. 4: Comparison under diverse retrievers. We employ the popular BMRETRIEVER [ 64 ] , E5 [ 62 ] , and MedCPT [ 42 ] . We compare retrieval-dependent baselines, including ICL, i-MedRAG, and TTT.
Fig. 5: Comparison under diverse LLMs. We employ Qwen2.5-1.5B [ 7 ] , Lingshu-7B [ 8 ] , and Qwen3-14B [ 60 ] . We select ICL, SFT, i-MedRAG, and TTT as representative baselines. We additionally incorporate TAGS for MedQA and AgentSimp for eLife due to their competitive performance.
Fig. 6: Comparison under diverse uncertainty estimation. Following [ 43 ] , we employ Entropy, Perplexity, and Energy. TTL-based baselines are included.
Fig. 7: Online vs. Offline test-time optimization. Online methods tailor the model to each test query individually prior to inference, whereas offline methods conduct a one-time optimization on the entire test set before evaluating queries sequentially. TTL-based baselines are included.
Fig. 8: OOD examination. (a) cross-dataset scenario. (b) cross-task scenario. For both scenarios, we use one domain as the pre-training / Index domain and then directly assess performance on the test set of the other domain.
Methods
MATH Reasoning
Knowledge QA-ReClor
AMC-ACC ↑
LogiQA-ACC ↑
ACC ↑
ROUGE-L ↑
SARI ↑
Qwen25-7B [ 7 ]
0.450
0.443
0.234
0.269
0.482
Linshu-7B [ 9 ]
0.040
0.388
0.205
0.259
0.479
ICL [ 17 ]
0.520
0.451
0.248
0.270
0.485
SFT [ 9 ]
0.500
0.488
0.246
0.227
0.466
Ensemble [ 61 ]
0.440
0.484
0.214
0.156
0.405
TABLE VI: Other Scenarios.
Fig. 9: Time complexity. To demonstrate practicality and fairness, for Fig. 9(a) and 9(b) , we test the inference time for the eLife dataset on a machine equipped with one A800 GPU.
Fig. 10: Case studies. Fig. 10(a) identifies critical tokens as those belonging to U (red) and certain tokens as those with X∖U (blue). Fig. 10(b) illustrates the transition in predictive entropy during generation with and without entropy control. Fig. 10(c) displays the answering accuracy on auxiliary QA pairs (generated by DeepseekV3) derived from the context, comparing performance before and after the tuning process on eLife.
Fig. 11: Illustrative examples. The upper panel displays our response, while the lower panel shows the response generated by TTT. For visual clarity, we use placeholders for the questions and few-shot examples.
Fig. 12: Hyper-parameter tests. Here, we take eLife as an example.
In-Context Reinforcement Learning (ICRL) enables Large Language Models (LLMs) to learn online from external rewards directly within the context window. However, a central challenge in ICRL is reward estimation, as models typically lack access to ground-truths during inference. To address this limitation, we propose Test-Time Rethinking for In-Context Reinforcement Learning (TR-ICRL), a novel ICRL framework designed for both reasoning and knowledge-intensive tasks. TR-ICRL operates by first retrieving the most relevant instances from an unlabeled evaluation set for a given query. During each ICRL iteration, LLM generates a set of candidate answers for every retrieved instance. Next, a pseudo-label is derived from this set through majority voting. This label then serves as a proxy to give reward messages and generate formative feedbacks, guiding LLM through iterative refinement. In the end, this synthesized contextual information is integrated with the original query to form a comprehensive prompt, with the answer determining through a final round of majority voting. TR-ICRL is evaluated on mainstream reasoning and knowledge-intensive tasks, where it demonstrates significant performance gains. Remarkably, TR-ICRL improves Qwen2.5-7B by 21.23% on average on MedQA and even 137.59% on AIME2024. Extensive ablation studies and analyses further validate the effectiveness and robustness of our approach. Our code is available at https://github.com/pangpang-xuan/TR_ICRL.
Wenxuan Jiang, Yuxin Zuo, Zijian Zhang +8
The Hong Kong Polytechnic University · Meituan-M17 · Institute of Computing Technology, Chinese Academy of Sciences +3
Despite the promise of Retrieval-Augmented Generation in grounding Multimodal Large Language Models with external knowledge, the transition to extensive contexts often leads to significant attention dilution and reasoning hallucinations. The surge in information density causes critical evidence to be submerged by voluminous noise, which complicates the discernment of relevant fragments within a dense input. In this paper, we propose Hit-RAG, a multi-stage preference alignment framework designed to resolve these cognitive bottlenecks through a progressive optimization pipeline. Our approach systematically refines the utilization of external evidence via three distinct stages. First, Supervised Fine-tuning establishes baseline context awareness to minimize information neglect. Next, Discriminative Preference Alignment enhances robustness against misleading distractors. Finally, Group-Relative Policy Optimization stabilizes logical synthesis to prevent reasoning collapse. Extensive evaluations on eight benchmarks demonstrate that Hit-RAG consistently yields substantial performance gains, enabling models to bridge the gap between context acquisition and accurate reasoning while surpassing much larger counterparts in long-context scenarios.
Junming Liu, Yuqi Li, Shiping Wen +2
Tongji University, Shanghai, China · The City University of New York, New York, USA · University of Technology Sydney, Sydney, Australia +2
We propose to improve in-context learning (ICL) by optimizing the continuous embeddings of a fixed few-shot prompt at test time. The key observation is that the log-probabilities a model assigns to its demonstrated outputs\unicodex2013available from a single forward pass without generating any tokens\unicodex2013provide a meaningful signal for how well the model has inferred the task from its demonstrations. We formalize this signal as a bounded, self-supervised confidence proxy and maximize it via zeroth-order optimization over the prompt embeddings, yielding a test-time calibration procedure. The approach requires no finetuning, no token generation, no predefined label set, and no external data, making it equally applicable to both classification and free-form generation tasks. Across a comprehensive suite of ICL tasks, the proposed calibration consistently matches or improves upon the base model and outperforms classification-specific baselines on most tasks. The statistically significant correlation between proxy improvement and downstream accuracy gain confirms that the proposed proxy encodes a reliable optimization signal for in-context learning.
Baturay Saglam, Dionysis Kalogerias
Department of Electrical and Computer Engineering Yale University