CORTEXA
← Browse
arxivcs.LGcs.AI2026-07-03

Best-of-Better-$N$: Generating Pre-Aligned Responses with In-Context Learning

Eric Lei, Hsiang Hsu, Chun-Fu Chen

Inference-time alignment methods, such as Best-of-$N$, offer a flexible alternative to training-based alignment by using reward models to select high-quality responses generated by a reference LLM. However, the efficacy of these methods is inherently limited by the response quality: if the reference LLM assigns negligible probability to high-reward responses, no selection strategy will succeed in finding aligned outputs. In this work, we propose Best-of-Better-$N$ (BoBN), an in context learning-based generation framework to address this challenge. Our method utilizes retrieval from high-reward examples relevant to the input query and task. Crucially, we introduce a restyling step where retrieved responses are rewritten by the reference LLM to align with the target task's format and style. These restyled examples are used in-context to shift the sampling distribution toward the high-reward region. We analytically characterize how in-context learning shifts the output distribution of pretrained transformers toward the high-reward region, resulting in provable benefits on the target task. We then evaluate BoBN on safety alignment and mathematical reasoning benchmarks across several reference LLMs. BoBN's higher-quality responses enable better performance to be achieved when the number of responses $N$ is fixed, and smaller $N$ required to achieve a target performance.

View free PDFSource page

Related papers

arxivcs.LGcs.AI2026-07-17

In-context learning of closed form solution to simple linear regression task using transformer with linear self-attention

Katsuyuki Hagiwara

In-context learning is a remarkable property of transformers and has recently received a lot of interest. In many studies of in-context learning, it has been shown that transformers are capable of implementing solver for linear and non-linear regression problems, in which the mos…

View free PDFSource page
arxivcs.LGcs.AI2026-07-20

Censoring-Aware In-Context Learning for Generalized Supplier Lead Time Estimation in Supply Chain Planning

Christopher Wang, Sebastien Ouellet, Behrouz Haji Soleimani, Ali Etemad

Supplier lead time forecasting is a central input to material requirements planning, inventory optimization, and supply chain risk management. However, many industrial lead time datasets are naturally right-censored: at the time forecasts are required, some orders have not yet ar…

View free PDFSource page
arxivcs.CLcs.AIcs.LG2026-07-17

Induction in Both Directions: A Mechanistic Analysis of In-Context Learning in Masked Diffusion Language Models

Andy Catruna, Emilian Radoi

While the internal mechanisms of autoregressive (AR) transformers have been studied extensively, much less is known about diffusion language models (DLMs), an emerging alternative that generates text by iterative denoising. In this work, we study how DLMs implement induction, a m…

View free PDFSource page
arxivcs.LGcs.AIcs.CEq-bio.QM2026-07-07

AbICL: In-Context Learning for Antigen-Specific Antibody Affinity Ranking

Zhiyuan Chen, Jing Hu, Junzhe Wang, Yueyang Huang, Xinyi Yang, Zhaoyang Wang, et al.

Accurate ranking of antibody candidates according to their binding affinity is essential for therapeutic antibody discovery. However, existing methods treat affinity comparisons independently and ignore the contextual information encoded in other labeled comparisons, limiting the…

View free PDFSource page
arxivcs.LGcs.AI2026-07-08

TimEE: End-to-end Time Series Classification via In-Context Learning

Jaris Küken, Shi Bin Hoo, Martin Mráz, Frank Hutter, Lennart Purucker

Time series classification (TSC) is dominated by a two-stage paradigm: train a feature encoder -- either from scratch on the target dataset or via pretraining on large corpora -- and then fit a task-specific classifier on top. While effective, this decoupling optimizes representa…

View free PDFSource page