{"url":"/method/lookahead","slug":"lookahead","name":"Lookahead","full_name":"Lookahead","full_name_withheld":false,"description_markdown":"**Lookahead** is a type of stochastic optimizer that iteratively updates two sets of weights: \"fast\" and \"slow\". Intuitively, the algorithm chooses a search direction by looking ahead at the sequence of *fast weights* generated by another optimizer.\r\n\r\n\r\n\r\n**Algorithm 1** Lookahead Optimizer\r\n\r\n**Require** Initial parameters $\\phi_0$, objective function $L$ \r\n\r\n**Require** Synchronization period $k$, slow weights step size $\\alpha$, optimizer $A$\r\n\r\n&nbsp;&nbsp;  **for** $t=1, 2, \\dots$\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp; Synchronize parameters $\\theta_{t,0} \\gets \\phi_{t-1}$\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp; **for** $i=1, 2, \\dots, k$\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sample minibatch of data $d \\sim \\mathcal{D}$\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $\\theta_{t,i} \\gets \\theta_{t,i-1} + A(L, \\theta_{t,i-1}, d)$\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp; **endfor**\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp; Perform outer update $\\phi_t \\gets \\phi_{t-1} + \\alpha (\\theta_{t,k} - \\phi_{t-1})$\r\n\r\n&nbsp;&nbsp; **endfor**\r\n\r\n&nbsp;&nbsp; **return** parameters $\\phi$","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":"https://arxiv.org/abs/1907.08610v2","title":"Lookahead Optimizer: k steps forward, 1 step back","url_on_a_paper_host":true},"code_snippet_url":"https://github.com/jettify/pytorch-optimizer/blob/155246597d66dd774156599be0f07a8c6f7758aa/torch_optimizer/lookahead.py#L13","code_snippet_url_on_a_code_host":true,"categories":[{"area":"General","area_id":"general","collection":"Stochastic Optimization","url":"/methods/category/stochastic-optimization","pwc_aliases":[]}],"n_papers_tagged":21,"archive_num_papers":null,"papers_newest_first":[{"paper":null,"title":"AutoChemSchematic AI: A Closed-Loop, Physics-Aware Agentic Framework for Auto-Generating Chemical Process and Instrumentation Diagrams","date":"2025-05-30","arxiv_id":"2505.24584","n_code_links":0,"syntology":null},{"paper":null,"title":"Lookahead Q-Cache: Achieving More Consistent KV Cache Eviction via Pseudo Query","date":"2025-05-24","arxiv_id":"2505.20334","n_code_links":0,"syntology":null},{"paper":null,"title":"Chronologically Consistent Large Language Models","date":"2025-02-28","arxiv_id":"2502.21206","n_code_links":0,"syntology":null},{"paper":null,"title":"Near Optimal Decision Trees in a SPLIT Second","date":"2025-02-21","arxiv_id":"2502.15988","n_code_links":0,"syntology":null},{"paper":null,"title":"Falcon: Faster and Parallel Inference of Large Language Models through Enhanced Semi-Autoregressive Drafting and Custom-Designed Decoding Tree","date":"2024-12-17","arxiv_id":"2412.12639","n_code_links":0,"syntology":null},{"paper":"/paper/break-the-sequential-dependency-of-llm","title":"Break the Sequential Dependency of LLM Inference Using Lookahead Decoding","date":"2024-02-03","arxiv_id":"2402.02057","n_code_links":1,"syntology":null},{"paper":"/paper/eagle-speculative-sampling-requires","title":"EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty","date":"2024-01-26","arxiv_id":"2401.15077","n_code_links":1,"syntology":null},{"paper":null,"title":"AlphaMapleSAT: An MCTS-based Cube-and-Conquer SAT Solver for Hard Combinatorial Problems","date":"2024-01-24","arxiv_id":"2401.13770","n_code_links":0,"syntology":null},{"paper":"/paper/stable-nonconvex-nonconcave-training-via-1","title":"Stable Nonconvex-Nonconcave Training via Linear Interpolation","date":"2023-10-20","arxiv_id":"2310.13459","n_code_links":1,"syntology":{"ran":5,"of":5,"unverified":0,"pointer_only":5}},{"paper":null,"title":"Using fine-tuning and min lookahead beam search to improve Whisper","date":"2023-09-19","arxiv_id":"2309.10299","n_code_links":0,"syntology":null},{"paper":null,"title":"Exploring Flat Minima for Domain Generalization with Large Learning Rates","date":"2023-09-12","arxiv_id":"2309.06337","n_code_links":0,"syntology":null},{"paper":null,"title":"Neurosymbolic Meta-Reinforcement Lookahead Learning Achieves Safe Self-Driving in Non-Stationary Environments","date":"2023-09-05","arxiv_id":"2309.02328","n_code_links":0,"syntology":null},{"paper":null,"title":"On the Depth between Beam Search and Exhaustive Search for Text Generation","date":"2023-08-25","arxiv_id":"2308.13696","n_code_links":0,"syntology":null},{"paper":"/paper/lookbehind-optimizer-k-steps-back-1-step","title":"Lookbehind-SAM: k steps back, 1 step forward","date":"2023-07-31","arxiv_id":"2307.16704","n_code_links":1,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":0}},{"paper":null,"title":"Judging Adam: Studying the Performance of Optimization Methods on ML4SE Tasks","date":"2023-03-06","arxiv_id":"2303.03540","n_code_links":0,"syntology":null},{"paper":null,"title":"Multilayer Lookahead: a Nested Version of Lookahead","date":"2021-10-27","arxiv_id":"2110.14254","n_code_links":0,"syntology":null},{"paper":null,"title":"Characterizing Lookahead Dynamics of Smooth Games","date":"2021-01-01","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":"/paper/taming-gans-with-lookahead","title":"Taming GANs with Lookahead-Minmax","date":"2020-06-25","arxiv_id":"2006.14567","n_code_links":1,"syntology":null},{"paper":"/paper/semg-gesture-recognition-with-a-simple-model","title":"sEMG Gesture Recognition with a Simple Model of Attention","date":"2020-06-05","arxiv_id":"2006.03645","n_code_links":2,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":3}},{"paper":"/paper/permute-to-train-a-new-dimension-to-training","title":"Train-by-Reconnect: Decoupling Locations of Weights from their Values","date":"2020-03-05","arxiv_id":"2003.02570","n_code_links":1,"syntology":{"ran":0,"of":1,"unverified":1,"pointer_only":0}},{"paper":"/paper/lookahead-optimizer-k-steps-forward-1-step","title":"Lookahead Optimizer: k steps forward, 1 step back","date":"2019-07-19","arxiv_id":"1907.08610","n_code_links":19,"syntology":null}],"papers_shown":21,"tasks":[{"task":"/task/language-modeling","name":"Language Modeling","papers":2},{"task":"/task/language-modelling","name":"Language Modelling","papers":2},{"task":"/task/machine-translation","name":"Machine Translation","papers":2},{"task":"/task/translation","name":"Translation","papers":2},{"task":"/task/chemical-process","name":"Chemical Process","papers":1},{"task":"/task/code-completion","name":"Code Completion","papers":1},{"task":"/task/code-generation","name":"Code Generation","papers":1},{"task":"/task/deep-learning","name":"Deep Learning","papers":1},{"task":"/task/diversity","name":"Diversity","papers":1},{"task":"/task/domain-generalization","name":"Domain Generalization","papers":1},{"task":"/task/emg-gesture-recognition","name":"EMG Gesture Recognition","papers":1},{"task":"/task/electromyography-emg","name":"Electromyography (EMG)","papers":1},{"task":"/task/gsm8k","name":"GSM8K","papers":1},{"task":"/task/gesture-recognition","name":"Gesture Recognition","papers":1},{"task":"/task/heuristic-search","name":"Heuristic Search","papers":1},{"task":"/task/humaneval","name":"HumanEval","papers":1},{"task":"/task/image-classification","name":"Image Classification","papers":1},{"task":"/task/instruction-following","name":"Instruction Following","papers":1},{"task":"/task/interpretable-machine-learning","name":"Interpretable Machine Learning","papers":1},{"task":"/task/lifelong-learning","name":"Lifelong learning","papers":1}],"tasks_shown":20,"n_tasks":27,"usage_by_year":[{"year":"2019","papers":1},{"year":"2020","papers":3},{"year":"2021","papers":2},{"year":"2023","papers":7},{"year":"2024","papers":4},{"year":"2025","papers":4}],"row_source":"embedded","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/lookahead"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}