[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-327726-105":59,"doc-detail-327726-en":130,"doc-similar-327726":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","best-of-better-n-generating-pre-aligned-responses-with-in-context-learning","Best-of-Better-N - Generating Pre-Aligned Responses with In-Context Learning","","Inference-time alignment methods such as Best-of-N provide a training-free alternative by using reward models to select high-quality responses from a reference LLM. Their effectiveness is limited when the reference model assigns negligible probability to high-reward answers. This work introduces Best-of-Better-N (BoBN), which retrieves high-reward in-context examples, restyles them via the reference LLM, and shifts sampling toward the high-reward region with theoretical guarantees.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/best-of-better-n-generating-pre-aligned-responses-with-in-context-learning/327726/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/best-of-better-n-generating-pre-aligned-responses-with-in-context-learning/327726.png","ImageObject",300,407,{"name":92,"@type":93},"Oliver","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-29","2026-09-21",true,{"@type":102,"interactionType":103,"userInteractionCount":44},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What limitation affects inference-time alignment methods like Best-of-N?","Question",{"text":112,"@type":113},"Their success depends on the reference LLM sampling at least one high-quality response. If the reference assigns negligible probability to high-reward outputs, selection cannot find aligned responses.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does Best-of-Better-N (BoBN) improve inference-time alignment?",{"text":117,"@type":113},"BoBN retrieves preference-identified high-reward examples relevant to the query, restyles retrieved responses to match the target format and style, and uses the restyled examples in context to shift the sampling distribution toward high-reward regions.",{"name":119,"@type":110,"acceptedAnswer":120},"What do the evaluations show for BoBN?",{"text":121,"@type":113},"BoBN achieves better performance on safety alignment and mathematical reasoning benchmarks across multiple reference LLMs, especially when the number of sampled responses is fixed or when fewer samples are needed to reach a target performance.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},327726,1790462969,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":44,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":56,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144,"preview_page_count":19,"preview_urls":145},8796095461610,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","arXiv :2607 .03453v 1 [ cs .LG] 3 Jul 2026  \nBest-of-Better-N: Generating Pre-Aligned Responses with In-Context Learning  \nEric Lei, Hsiang Hsu & Chun-Fu (Richard) Chen  \nJPMorganChase Global Technology Applied Research  \n{eric.lei,hsiang.s.hsu,[richard.cf.chen](richard.cf.chen}@jpmchase.com)[}](richard.cf.chen}@jpmchase.com)[@jpmchase.com](richard.cf.chen}@jpmchase.com)  \nAbstract  \nInference-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.  \nWe 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 Nis fixed, and smaller N required to achieve a target performance.  \n1 Introduction  \nInference-time alignment (ITA) is a paradigm which has achieved remarkable performance gains for various downstream tasks performed by large language models (LLMs) without requiring further training (Snell et al. , 2025) . These methods provide an adaptable and easy-to-use alternative to the standard LLM post-training pipeline, where a pretrained LLM may undergo supervised fine-tuning and reinforcement learning (Bai et al. , 2022 ; Ouyang et al. , 2022) to align the model with human preferences and boost performance on downstream tasks. Such tasks may include improved helpfulness and engagement during chat-bot interactions, more accurate reasoning chains for arithmetic tasks, or refusal capabilities when prompted with toxic material.  \ny ∼ πref (·|x)  y ∼ πref (·|CK , x)  \n− Reward +  \nFigure 1: Standard inference-time alignment methods, e.g., Best-of-N , may not produce any high-quality responses yi ∼πref (·|x) when πref is not aligned to the downstream task, causing selection of a poor response. Our method, BoBN, utilizes preference-retrieved in-context examples CK to shift the πref sampling distribution toward the high-reward region without any finetuning, enabling selection of a more aligned response.  \nWhile the LLM post-training pipeline has proven highly successful for real-world deployment of LLMs (Ouyang et al. , 2022 ; Guo et al. , 2025), it is both impractical and costly due to unavailability of the LLM weights and the high cost of training. ITA presents a training-free substitute by performing a proxy version entirely at inference time, enabling improved performance on downstream tasks without needing LLM weights or likelihood access.  \nCurrent ITA methods typically operate in the sample-and-evaluate framework (Huang et al. , 2025) . Specifically, let πref be a reference LLM which we wish to align at inference time. Given a prompt x, an ITA method will sample responses from πref (·|x), and then select an output response according to a criterion. This criterion typically depends on a reward model which encodes response quality; larger rewards imply a more desired response for the task of interest. For example, the best-of-N (BoN) criterion (Stiennon et al. , 2020","cbCaicnRQXydDnsE","https://ap.wps.com/l/cbCaicnRQXydDnsE","pdf",1404071,"English","# Abstract\n# 1 Introduction","[{\"question\":\"What limitation affects inference-time alignment methods like Best-of-N?\",\"answer\":\"Their success depends on the reference LLM sampling at least one high-quality response. If the reference assigns negligible probability to high-reward outputs, selection cannot find aligned responses.\"},{\"question\":\"How does Best-of-Better-N (BoBN) improve inference-time alignment?\",\"answer\":\"BoBN retrieves preference-identified high-reward examples relevant to the query, restyles retrieved responses to match the target format and style, and uses the restyled examples in context to shift the sampling distribution toward high-reward regions.\"},{\"question\":\"What do the evaluations show for BoBN?\",\"answer\":\"BoBN achieves better performance on safety alignment and mathematical reasoning benchmarks across multiple reference LLMs, especially when the number of sampled responses is fixed or when fewer samples are needed to reach a target performance.\"}]","Best-of-Better-N - Generating Pre-Aligned Responses with In-Context Learning | PDF",1789977914,48,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/ad432f0f8accbfba4a4e777019d9995f.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/148b788477e68486275adbe54aa5ece1.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/00fd48480b53d52c6058e082f079ca77.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/40e130eda710745033eb805e0cbf21c8.webp",980,1268,{"list":163,"token":66},[164,171,178,185,192,199,206,213,219,226],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":169,"category_name":40,"create_tm":170},122799,"Fundamental Limits of Membership Inference Attacks on Machine Learning Models","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229836944469/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=B%2FZM8AMeoU6pmkxekCUwbM%2BZ%2FOY%3D","fundamental-limits-of-membership-inference-attacks-on-machine-learning-models",13,1785812960,{"doc_id":172,"doc_title":173,"file_type":137,"home_preview_img_url":174,"slug":175,"view_count":176,"category_name":40,"create_tm":177},391031,"Prϵϵmpt: Sanitizing Sensitive Prompts for LLMs","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917602714/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=vPqCueqYTpTIBFi30oFOBp5V%2Fco%3D","prmpt-sanitizing-sensitive-prompts-for-llms",18,1790345905,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":183,"category_name":40,"create_tm":184},86263,"PaperRouter-Agent: A Content-Grounded LLM Agent for Personalized Hierarchical Paper Routing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809395331/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=knL%2BJ9T9ZWQZ%2FM%2BpPHQGVo8Pk2c%3D","paperrouter-agent-a-content-grounded-llm-agent-for-personalized-hierarchical-paper-routing",22,1784209903,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":190,"category_name":40,"create_tm":191},268245,"OpenIntro Statistics - Fourth Edition - Learning statistical thinking and applied inference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229898167169/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=jd37GBlck%2FK2RacpztD9atngkuY%3D","openintro-statistics-fourth-edition-learning-statistical-thinking-and-applied-inference",39,1789429599,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":197,"category_name":40,"create_tm":198},117329,"Comprehensive Causal Machine Learning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834469677/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=wBo24dumg%2F9O0HLGtTbtXRAJyaE%3D","comprehensive-causal-machine-learning",27,1785675220,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":204,"category_name":40,"create_tm":205},85463,"CoRL-MPPI: 用可学习行为增强 MPPI 的高效且可证明安全的多机器人避碰","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809315261/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=CfvHort5MwlZDxE9oe95UTTp1tg%3D","corl-mppi-enhancing-mppi-with-learnable-behaviours-for-efficient-and-provably-safe-multi-robot-collision-avoidance",24,1784203745,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":211,"category_name":40,"create_tm":212},81666,"No, Cake Cutting Really is a Piece of Cake","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808636527/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=Ve1M%2BZ0PXH9TFDZP5Ip2PQEhlTU%3D","no-cake-cutting-really-is-a-piece-of-cake",21,1784175296,{"doc_id":214,"doc_title":215,"file_type":137,"home_preview_img_url":216,"slug":217,"view_count":46,"category_name":40,"create_tm":218},83622,"Scalable and Distributed Silhouette Approximation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808875097/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=wKe5%2Buc0s3SwnBxeVecvJjsO0EQ%3D","scalable-and-distributed-silhouette-approximation",1784189340,{"doc_id":220,"doc_title":221,"file_type":137,"home_preview_img_url":222,"slug":223,"view_count":224,"category_name":40,"create_tm":225},151943,"ROC-n-reroll - How verifier imperfection affects test-time scaling","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229869771580/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=GdPwzocgJwRUUhEA1ancIPvyJcw%3D","roc-n-reroll-how-verifier-imperfection-affects-test-time-scaling",14,1787853257,{"doc_id":227,"doc_title":228,"file_type":137,"home_preview_img_url":229,"slug":230,"view_count":183,"category_name":40,"create_tm":231},84941,"When Does In-Context Search Help? A Sampling-Complexity Theory of Reflection-Driven Reasoning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809080348/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109539&Signature=HPSXaZ%2B2NbuaO4qF%2B%2Bpfd5wSZC4%3D","when-does-in-context-search-help-a-sampling-complexity-theory-of-reflection-driven-reasoning",1784199603]