[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84941-en":3,"doc-seo-84941-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},84941,687197207639,"Asher","https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd",8,"Research & Report","When Does In-Context Search Help? A Sampling-Complexity Theory of Reflection-Driven Reasoning","Large language models with extended reasoning can perform in-context search, iteratively generating, critiquing, and revising solution attempts. The work provides a theoretical framework that models this behavior as approximate inference over reasoning traces, combining a base-model prior with self-reflection feedback for posterior updates. It analyzes inference-time sampling complexity—the number of sequential attempts needed for high success probability. Results show exponential gains when reflections reliably pinpoint early mistakes, and no asymptotic benefit when localization fails, with learnable robustness validated on real models.","arXiv :2607 .06720v 1 [ cs .AI ] 7 Jul 2026  \nWhen Does In-Context Search Help? A Sampling-Complexity Theory of ReflectionDriven Reasoning  \nYotam Wolf, Noam Wies, Amnon Shashua  \nThe Hebrew University  \n{yotamwolf,noam.wies,[shashua}@cs.huji.ac.il](shashua}@cs.huji.ac.il)  \nAbstract  \nTraining large language models (LLMs) with extended reasoning has enabled in-context search, in which models iteratively generate, critique, and revise solution attempts. We provide a theoretical analysis of in-context search by modeling it as approximate inference over reasoning traces, where the base model defines a prior and self-reflection provides feedback for posterior updates, and study the resulting inference-time sampling complexity-the number of sequential attempts needed to achieve high success probability.  \nWe show that when reflections reliably localize early mistakes, in-context search can yield exponential improvements over the base model, solving problems with exponentially small zero-shot pass rates using only a polynomial number of sequential attempts, whereas when this property fails, conditioning on past attempts offers no asymptotic benefit over parallel sampling. We further show that these gains are robust and learnable: approximate posterior updates suffice, and cross-entropy training on search rollouts recovers the required behavior with polynomial sample complexity.  \nFinally, we show that under a stagewise abstraction of reinforcement learning with verifiable rewards, the optimal policy extension implements the same posterior reweighting rule. We validate key qualitative predictions of the theory on real large reasoning models.  \n1 Introduction  \nChain-of-thought (CoT) reasoning represents an LLM’s intermediate reasoning steps as a sequence connecting the input to the final answer, and was originally used to decompose complex tasks into more manageable subtasks (Wei et al., 2022) . Subsequent methods such as tree of thought, self-consistency, and reflection extended this paradigm by exploring multiple reasoning paths, evaluating alternatives, and iteratively refining conclusions (Yao et al., 2023; Wang et al., 2022; Shinn et al., 2023), leading to the emergence of large reasoning models (LRMs) that solve problems through sequential revisions and multiple solution attempts, a process known as “in-context search” (Jaech et al., 2024; Chen et al., 2021; Li et al., 2022; Alp, 2023; Ridnik et al., 2024) . This paradigm has enabled high accuracy on reasoning problems under single-sample inference, outperforming earlier LLMs that relied on extensive multi-sample aggregation (Chollet, 2024), and has been prominently observed in models trained with reinforcement learning with verifiable rewards (RLVR), such as DeepSeek-R1 (Guo et al., 2025) and Kimi-k1.5 (Team et al., 2025), where search-like reasoning within the context window emerges from training. It has since motivated a growing body of work on reinforcement-based reasoning and search behavior (Yeo et al., 2025; Wang et al., 2025; Liu et al., 2025; Yu et al., 2025) .  \nDespite these successes, it remains unclear when in-context search provides genuine advantages over parallel sampling from a base model, and when it does not. We study this question through the lens of inference-time sampling complexity: how many sequential attempts (or backtracks) are required to achieve high success probability, compared to parallel sampling from the base model. The recent theoretical work of Shalev-Shwartz and Shashua (2025)  \ndemonstrated exponential sample efficiency using an explicit tree-search procedure that prunes failed branches by removing them from context. In contrast, modern LRMs typically retain the full history of attempts in-context, raising the question of when this unstructured form can match the same guarantees.  \nIn this work, we address this question by theoretically characterizing the search process underlying in-context search. Building on the search-based perspective ","cbCaimFWCPdGeh0t","https://ap.wps.com/l/cbCaimFWCPdGeh0t","pdf",1125556,1,36,"English","en",105,"# Abstract\n# Introduction\n## Chain-of-thought and search-like reasoning\n## Sampling complexity as the evaluation lens\n## Reflection as the key determinant\n## Robustness and learnability\n## Reinforcement learning stagewise abstraction\n# Validation on large reasoning models","[{\"question\":\"What does the document consider as the main measure of performance for in-context search?\",\"answer\":\"It evaluates inference-time sampling complexity, defined as the number of sequential attempts (backtracks) needed to reach high success probability, contrasted with parallel sampling from the base model.\"},{\"question\":\"When can in-context search provide exponential improvements?\",\"answer\":\"When reflections reliably localize early mistakes, posterior updates can suppress wrong continuations early enough to achieve exponential gains over the base model.\"},{\"question\":\"What happens when reflection fails to localize errors early?\",\"answer\":\"If reflections only identify mistakes at late stages, conditioning on past attempts does not yield asymptotic improvement over parallel sampling and can even degrade performance.\"}]",1784199603,91,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"when-does-in-context-search-help-a-sampling-complexity-theory-of-reflection-driven-reasoning","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/when-does-in-context-search-help-a-sampling-complexity-theory-of-reflection-driven-reasoning/84941/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-17","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What does the document consider as the main measure of performance for in-context search?","Question",{"text":75,"@type":76},"It evaluates inference-time sampling complexity, defined as the number of sequential attempts (backtracks) needed to reach high success probability, contrasted with parallel sampling from the base model.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"When can in-context search provide exponential improvements?",{"text":80,"@type":76},"When reflections reliably localize early mistakes, posterior updates can suppress wrong continuations early enough to achieve exponential gains over the base model.",{"name":82,"@type":73,"acceptedAnswer":83},"What happens when reflection fails to localize errors early?",{"text":84,"@type":76},"If reflections only identify mistakes at late stages, conditioning on past attempts does not yield asymptotic improvement over parallel sampling and can even degrade performance.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]