Stanford CS329A Self-Improving AI Agents | Part 7 | Self-Improvement and Deep Research Agents

The lecture explores advancements in AI problem-solving through improved search and sampling techniques, highlighting systems like AlphaCode and Search-o1 that enhance code generation and deep research capabilities by integrating iterative reasoning, diverse solution generation, and retrieval-augmented methods. It also addresses challenges such as model overconfidence, retrieval precision, and the need for iterative refinement to boost AI accuracy and efficiency in complex tasks.

The lecture focuses on improving AI models through search techniques, particularly in the context of code generation and deep research agents. It begins with an overview of AlphaCode, an AI system designed to solve competitive programming problems end-to-end, which is more complex than simple code completion tasks. AlphaCode was notable for ranking in the top 54% of contest participants across multiple competitions, demonstrating AI’s ability to generalize beyond narrow tasks. The system involved pre-training models on large datasets from GitHub and code contests, generating a massive number of code samples (up to one million per problem), and then filtering and clustering these samples to select diverse and correct solutions for submission and evaluation.

The lecture then discusses the challenges and improvements in AlphaCode 2, which replaced pre-training with fine-tuning of an existing large language model (Gemini Pro) and introduced multiple model variants to enhance diversity in generated solutions. AlphaCode 2 also incorporated a learned scoring model to better select high-quality candidate solutions, significantly improving performance—achieving nearly double the solve rate of the original AlphaCode with fewer samples. Despite these advances, the approach still faced inefficiencies, such as generating many incorrect or non-compiling samples, highlighting the need for better sampling and refinement methods.

Next, the discussion shifts to how these methods can be adapted based on task complexity and how reasoning can be embedded directly into models. For simpler problems, fewer samples may suffice, while harder problems might require more extensive sampling or multi-step reasoning. Embedding reasoning involves incorporating chain-of-thought prompts or decomposing problems into subproblems, allowing models to reason step-by-step and potentially backtrack if intermediate steps are incorrect. This multi-agent or multi-step approach is seen as a promising direction for improving AI problem-solving capabilities.

The latter part of the lecture introduces Search-o1, a system designed to build deep research agents by combining large reasoning models with retrieval-augmented generation (RAG). Unlike simple RAG, which retrieves documents once at the start, Search-o1 iteratively generates search queries during reasoning to fill knowledge gaps, analyzes retrieved documents to extract relevant information, and integrates this refined knowledge back into the reasoning process. This approach reduces uncertainty and improves accuracy, especially in complex, multi-step queries, outperforming traditional RAG methods and achieving competitive results with human experts in domains like physics and biology.

Finally, the lecture addresses questions about model confidence, calibration, and the challenges of retrieval precision and recall. It notes that language models often exhibit overconfidence in their outputs, which can lead to errors or hallucinations. Efforts to improve calibration through reinforcement learning and better scoring models are ongoing. The importance of effective retrieval and summarization of relevant documents is emphasized, as is the need for iterative refinement in both code generation and research agent contexts. Overall, the lecture highlights the evolving strategies to enhance AI agents’ problem-solving and reasoning abilities through sophisticated search, sampling, and retrieval techniques.