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.AIeess.AS2026-07-31

Versatile On-device Adaptation at the Edge by Unifying Few-shot, Zero-shot, Continual, and In-context Learning

Douwe den Blanken, Martin Lefebvre, Charlotte Frenkel

With the ever-increasing pervasiveness of smart edge devices, the demand is growing for applications that can be tailored to users (e.g., custom keyword spotting) or patients (e.g., adaptive health monitoring). Yet, most edge devices rely on fixed inference algorithms and thus ca…

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

Multi-turn RL with Structural and Performance Aware Rewards for CUDA Kernel Generation

Quazi Ishtiaque Mahmud, Nesreen K. Ahmed, Ali Jannesari

Reinforcement Learning with Verifiable Rewards (RLVR) has emerged as a powerful technique to enhance the reasoning capacity of LLMs for optimized code generation. However, existing RLVR approaches primarily rely on outcome-based signals such as correctness and speedup, overlookin…

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

CEL: Comprehensive Counterfactual Explanations Library and Benchmark

Oleksii Furman, Łukasz Lenkiewicz, Marcel Musiałek, Maciej Zięba

Counterfactual explanations are a prominent approach in explainable artificial intelligence (xAI), providing actionable guidance on what input changes would alter a model's prediction to a desired outcome. While early methods primarily focused on minimal feature changes, recent w…

View free PDFSource page
arxivquant-phcs.AIcs.LG2026-07-24

Quantum Spectral Model: Data Reuploading with Input-Conditioned Frequency Support

Peiyong Wang, Udaya Parampalli, Casey R. Myers

A central design principle in modern machine learning and artificial intelligence is to align a model's inductive bias with the structure of its input data. For matrix-valued inputs, relevant matrix-level relationships can be characterised through spectral values and spectral sub…

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

SAF-OPD: Stable Advantage Fusion for On-Policy Distillation

Yifan Ding, Xincheng Wei, Yoshua Y. Li, Ziheng Li, Yuquan Lu, Siyu Zhang, et al.

Reinforcement learning with verifiable rewards (RLVR) broadcasts a single response-level reward to every token, while on-policy distillation (OPD) scores each token against a stronger teacher for a dense advantage but caps performance at teacher quality and discourages exploratio…

View free PDFSource page