Training large language models more efficiently

Training separate models on different datasets and then merging them reduces computational costs by as much as 91%.

Large language models (LLMs) go through several stages of training on mixed datasets with different distributions, stages that include pretraining, instruction tuning, and reinforcement learning from human feedback. Finding the optimal mix of data distributions across datasets is essential to building accurate models, but it typically requires training and evaluating the model numerous times on a very large set of combinations.

At the last Conference on Empirical Methods in Natural-Language Processing (EMNLP), my colleagues and I proposed a training framework that reduces the computational cost of using mixed data distributions to train LLMs or other neural-network-based models by up to 91%. At the same time, the method actually improves the quality of the resulting models.

Whereas the standard approach to optimizing data distributions involves weighting the different datasets used to train a single model, we train a separate model on each dataset and then weight the models to produce a composite model.

This unconventional approach won a special award for “efficient modeling, training, and inference” at EMNLP and has the potential to make large-model training much more efficient and accessible.

Distribution-edited models

Traditional training approaches (e.g., instruction tuning) select the optimal mix of training data distributions through a method called grid search, an exhaustive-search method that simply compares outcomes for a wide range of different weight values. This is very demanding not only in terms of time and resources but also in terms of flexibility: once the model is trained, it can’t be changed without incurring similar costs.

To address these limitations, we propose fine-tuning a pretrained model on data distributions that correspond to different tasks and then subtracting the parameter values of the original model from those of the fine-tuned models. We call the differences in parameter values distribution vectors, and we produce a composite model by adding a weighted sum of distribution vectors to the parameters of the original model.

Related content
Theoretical analysis provides insight into the optimization process during model training and reveals that for some optimizations, the Gaussian attention kernel may work better than softmax.

We call the resulting model a distribution-edited model (DEM) to highlight the leveraging of weight vector arithmetic for model editing. The weights are based on the perplexity of each fine-tuned model, or the probability that its parameter values can be predicted from those of the original model.

This approach relies on two key observations: (1) training the model separately on each dataset allows better modeling of each dataset’s underlying properties, as there is no interference with other data distributions during the training process; and (2) perplexity can be computed in a single forward pass on validation data, which is much more efficient than grid search. The first point helps improve model quality, and the second point helps make training much more efficient.

In more detail, here are the steps in the approach:

  1. Individual-distribution training: The original model is trained on individual data distributions through standard training procedures. Checkpoints, or snapshots of the model state after training on a particular dataset, are stored for subsequent steps.
  2. Distribution vector computation: Distribution vectors are computed by subtracting the pretrained model's parameters from those of the fine-tuned models. These vectors capture the unique characteristics of each dataset.
  3. Optimization of merging coefficients: The optimal coefficients for combining the data distribution vectors are found based on perplexity on the validation set using a single forward pass per combination.
  4. Merging of distribution vectors: Linearly combining the distribution vectors with customizable weights creates a unified model that effectively captures the joint distribution of diverse datasets.
  5. Resulting properties (flexibility and scalability): DEM enables incremental updates when new datasets are introduced, without requiring full retraining. This makes it ideal for dynamic and large-scale training scenarios.
Distribution-edited models.jpg
With distribution-edited models (DEMs), a pretrained model is fine tuned on data distributions that correspond to different tasks D1 – ΘDn). Then the parameter values of the original model (Θ) are subtracted from those of the fine-tuned models, producing a set of distribution vectors (ΔΘD1 – ΔΘDn). The DEM is a composite D) produced by adding a weighted sum of distribution vectors (Σ) to the parameters of the original model.

Evaluation and future work

In evaluating our approach, we focused on training LLMs of increasing size, from 3 billion parameters up to 13 billion parameters, during the instruction-tuning stage. Our study showed that DEM reduces training costs by up to 91% while achieving up to 16.1% quality improvement over traditional data-mixing strategies, highlighting DEM’s potential to democratize access to state-of-the-art training techniques and offer transformative benefits to organizations leveraging neural models at scale. In addition, DEM’s flexibility ensures that researchers and practitioners can quickly adapt to new data requirements without compromising performance.

Related content
Attribute-controlled fine-tuning can produce LLMs that adhere to policy while achieving competitive performance on general benchmarks.

The key takeaways from the study can be summarized as follows:

  • Superior performance: DEM has been validated on popular benchmarks like MMLU, BBH, and HELM, where it achieved up to 16.1% improvement over data mixing on individual tasks.
  • Diverse domain effectiveness: Experiments on datasets such as MathQA, Super-Natural Instructions (SNI), and Chain-of-Thought (CoT) demonstrate DEM’s ability to excel across a variety of domains.
  • Scalability: DEM is shown to improve performance at different model sizes — 3B, 7B and 13B — providing strong evidence for the scalability of this approach.

The effectiveness of DEM underscores the importance of innovation in making machine learning more efficient and accessible. As the machine learning community continues to scale models and datasets, frameworks like DEM will be essential for maintaining efficiency without sacrificing performance. Future research may explore the effectiveness of the framework on other training scenarios and its extension to other model architectures, such as encoder-decoder frameworks or mixture-of-experts models.

Research areas

Related content

US, NY, New York
Are you a scientist interested in pushing the state of the art in machine learning and recommendation systems? Are you interested in working on novel ideas that can positively impact millions of customers? Do you wish you had access to large datasets and tremendous computational resources? Answer yes to any of these questions and you will be a great fit for our team at Amazon. As an Applied Scientist in our team, you will be responsible for the research, design, and development of new AI technologies for Personalization. You will adopt or invent new machine learning and analytical techniques in the realm of recommendations and large language models. You will collaborate with scientists, engineers, and product partners locally and abroad. Your work will include inventing, experimenting with, and launching new features, products and systems. Key job responsibilities - Using Amazon’s large-scale computing resources, you will ask research questions about customer behavior, build state-of-the-art models to optimize the shopping experience, and run these models directly on the retail website. - Develop AI solutions for Recommendation systems using Deep learning, LLMs, Reinforcement Learning, distillation, and Optimization methods; - Work closely with engineers and product managers to design, implement and launch AI solutions end-to-end; - Design and conduct offline and online (A/B) experiments to evaluate proposed solutions based on in-depth data analyses; - Effectively communicate technical and non-technical ideas with teammates and stakeholders; - Stay up-to-date with advancements and the latest modeling techniques in the field; - Publish your research findings in top conferences and journals. About the team Our team is part of Amazon’s Personalization organization, a high-performing group that leverages Amazon’s expertise in machine learning, big data, distributed systems, and user experience design to deliver the best shopping experiences for our customers. We run global experiments and our work has revolutionized e-commerce with features such as "Keep shopping for ...", “Customers who bought this item also bought”, and “Frequently bought together”.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
IN, KA, Bengaluru
Amazon Ads delivers advertising experiences across Amazon's owned-and-operated properties and third-party networks, reaching hundreds of millions of customers worldwide. Within Amazon Ads, Advertising Trust is the science-first organization responsible for ensuring every ad shown to customers meets Amazon's content policies — at massive scale, across all ad formats and global marketplaces. The Ads Trust Science team builds the ML systems that automate content moderation decisions: multimodal classification, retrieval-based labeling, LLM reasoning, and agentic self-improvement architectures. This requires inventing new approaches at the intersection of computer vision, NLP, information retrieval, and generative AI. We are seeking an Applied Science Manager to lead a team of applied scientists building next-generation content moderation intelligence. You will own the science roadmap for one of the highest-impact automation programs in Amazon Advertising, defining how multimodal content understanding, retrieval-first classification, and LLM-based reasoning combine into a production system that serves global advertising at scale. Key job responsibilities * Lead a team of applied scientists working across multimodal ML (vision-language models, video understanding), large-scale retrieval systems (embedding-based similarity and deduplication), and generative AI (LLM-based policy reasoning, knowledge distillation, agentic architectures, reinforcement learning). * Define the science strategy for ads trust. * Own end-to-end delivery of ML solutions: problem formulation, offline experimentation, online A/B testing, and production deployment. Your models directly move automation and defect metrics reported to senior leadership. * Build and grow scientists — hire, mentor, and develop team members. Raise the science bar through structured review processes and a publication culture within Amazon. * Partner with engineering, product, and operations teams to translate science investments into measurable automation improvements. Influence roadmaps across dependent teams. * Communicate science strategy and results to senior leadership through narratives, technical deep-dives, and roadmap documents.
US, WA, Seattle
Stores Economics and Science (SEAS) is an interdisciplinary science and engineering team in Amazon's Stores organization with a peak-jumping mission: we apply expertise in science and engineering to move from local to global optima in methods, models, and software. We pursue this mission by leveraging frontier science; collaborating with partner teams; and learning from the tools, experience, and perspective of others. We scale by solving problems, first in the small to prove concepts, and then in the large by building scalable solutions. We also help other teams within Amazon scale by hiring and developing the best and embedding them in other business units. In 2026, we are focused on economics and science in areas related to (1) lowering cost-to-serve, (2) optimizing selection, and (3) emerging machine learning. We also have some ongoing and highly-leveraged collaborations that help partner teams inside Amazon short-circuit months of R&D or otherwise look around corners. We are looking for an Applied Scientist to build and deliver state-of-the-art science and engineering solutions to improve our Stores business. In this role, you will work in a team of scientists and engineers with backgrounds in machine learning, NLP, IR, statistics, and economics to identify bottlenecks in our business, conceive new ideas to overcome those challenges, and deploy scientific solutions in partnership with product teams. Your responsibilities include developing and maintaining the scientific models, benchmarks, and services. Graduate education or hands-on experience in machine learning, optimization, causal inference, Bayesian statistics, deep learning, or other quantitative scientific fields is a big plus. To be successful in this role, you should be a quick learner and comfortable with a high degree of ambiguity. Key job responsibilities The successful candidate will lead large-scale science initiatives from research to production and translate complex business problems into mathematical frameworks. They will design and implement large-scale algorithms for complex supply chain and marketplace problems, and design incentive-compatible mechanisms for marketplace challenges. The ideal candidate will have a strong publication record in top-tier conferences/journals (INFORMS, EC, WINE, ICML, NeurIPS, etc.) and experience coordinating cross-functional projects. Hands-on experience building science solutions to mechanism design problems (e.g., optimal auction design, welfare maximization under constraints, incentive compatible coordination), with expertise in statistical learning and algorithm development. Leadership responsibilities include influencing technical strategy and roadmaps for complex initiatives, influencing senior stakeholders and shaping technical direction, and fostering team growth.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
US, WA, Seattle
Innovators wanted! Are you an entrepreneur? A builder? A dreamer? This role is part of an Amazon Special Projects team that takes the company’s Think Big leadership principle to the limits. We focus on creating entirely new products and services with a goal of positively impacting the lives of our customers. No industries or subject areas are out of bounds. If you’re interested in innovating at scale to address big challenges in the world, this is the team for you. Here at Amazon, we embrace our differences. We are committed to furthering our culture of inclusion. We have thirteen employee-led affinity groups, reaching 40,000 employees in over 190 chapters globally. We are constantly learning through programs that are local, regional, and global. Amazon’s culture of inclusion is reinforced within our 16 Leadership Principles, which remind team members to seek diverse perspectives, learn and be curious, and earn trust. As a Applied Scientist at the intersection of machine learning and the life sciences, you will participate in developing exciting products for customers. Our team rewards curiosity while maintaining a laser-focus in bringing products to market. Competitive candidates are responsive, flexible, and able to succeed within an open, collaborative, entrepreneurial, startup-like environment. At the forefront of both academic and applied research in this product area, you have the opportunity to work together with a diverse and talented team of scientists, engineers, and product managers and collaborate with others teams.
US, WA, Seattle
Interested in modeling and understanding customer behavior through machine learning, artificial intelligence, and data mining over TB scale data with huge business impact on millions of customers? Join our team of Scientists developing models to model customer behavior and optimize the customer experience with Amazon Prime. This includes understanding who our customers are, long-term value of the Prime membership program, and creating the right personalized framework for content and subscription optimization. As an AI/ML expert, you will partner directly with product owners to intake, build, and directly apply your modeling solutions. There are numerous scientific and technical challenges you will get to tackle in this role, such as optimizing/fine-tuning GenAI/LLM solutions for Prime personalization, building GenAI foundation models, global scalability of models, combinatorial optimization, cold start problem, accelerated experimentation, short/long term goals modeling, and multi-step optimization leading to reinforcement learning of the customer journey. We employ techniques from GenAI/LLMs, supervised/semi-supervised learning, deep learning, transformer architectures, using outcomes from causal Econometric modeling, and Reinforcement learning. As the central science team within Prime, our expertise gets routinely called upon to weigh in on a variety of topics. We also emphasize the need and value of scientific research and have developed a strong publication and patent record (internally/externally) which you will be a part of. You will also utilize and be exposed to the latest in ML technologies and infrastructure: AWS technologies (EMR/Spark, Sagemaker, DynamoDB, S3, ClaudeCode), various AI/ML algorithms and techniques (Deep Learning, GenAI/LLMs, transformers, supervised/unsupervised/semi-supervised/reinforcement learning), and statistical modeling techniques. - Stay abreast of current literature in the field and advance/build novel science solutions leveraging SoTA solutions. - Build and develop AI/ML models and supporting infrastructure at TB scale, in coordination with software engineering teams. - Leverage Deep Learning and GenAI solutions for building foundation models and personalized optimization solution. - Develop offline policy estimation tools and integrate with measurement systems/econometric models. - Establish scalable, efficient, automated processes for large scale data analyses, science development, science validation and model implementation. - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes. - Work closely with the business to understand their problem space, identify the opportunities and formulate the problems. - Use AI/machine learning, data mining, statistical techniques and others to create actionable, meaningful, and scalable solutions for the business problems. - Design, develop and evaluate highly innovative models and statistical approaches to understand and predict customer behavior and to solve business problems. Key job responsibilities - Stay abreast of current literature in the field and advance/build novel science solutions leveraging SoTA solutions. - Build and develop AI/ML models and supporting infrastructure at TB scale, in coordination with software engineering teams. - Leverage Deep Learning and GenAI solutions for building foundation models and personalized optimization solution. - Develop offline policy estimation tools and integrate with measurement systems/econometric models. - Establish scalable, efficient, automated processes for large scale data analyses, science development, science validation and model implementation. - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes. - Work closely with the business to understand their problem space, identify the opportunities and formulate the problems. - Use AI/machine learning, data mining, statistical techniques and others to create actionable, meaningful, and scalable solutions for the business problems. - Design, develop and evaluate highly innovative models and statistical approaches to understand and predict customer behavior and to solve business problems.
US, NY, New York
We are seeking a Robotics/AI Motor Control Scientist to develop cutting-edge machine learning algorithms for motor control systems in robots. In this role, you will focus on creating and optimizing intelligent motor control strategies to enable robots to perform complex, whole-body tasks. Your contributions will be essential in advancing robotics by enabling fluid, reliable, and safe interactions between robots and their environments. Key job responsibilities - Develop controllers that leverage reinforcement learning, imitation learning, or other advanced AI techniques to achieve natural, robust, and adaptive motor behaviors - Collaborate with multi-disciplinary teams to integrate motor control systems with robotic hardware, ensuring alignment with real-world constraints such as actuator dynamics and energy efficiency - Use simulation and real-world testing to refine and validate control algorithms - Stay updated on advancements in robotics, AI, and control systems to apply advanced techniques to robotic motion challenges - Lead technical projects from conception through production deployment - Mentor junior scientists and engineers - Bridge research initiatives with practical engineering implementation About the team Fauna Robotics, an Amazon company, is building capable, safe, and genuinely delightful robots for everyday life. Our goal is simple: make robots people actually want to live and interact with in everyday human spaces. We believe that future won’t arrive until building for robotics becomes far more accessible. Today, too much effort is spent reinventing the fundamentals. We’re changing that by developing tightly integrated hardware and software systems that make it faster, safer, and more intuitive to create real-world robotic products. Our work spans the full stack: mechanical design, control systems, dynamic modeling, and intelligent software. The focus is not just functionality, but experience. We’re building robots that feel responsive, expressive, and genuinely useful. At Fauna, you’ll work at the frontier of this space, helping define how robots move, manipulate, and interact with people in natural environments. It’s an opportunity to solve hard problems across hardware and software with a team focused on making robotics accessible and joyful to build. If you care about making robotics real for everyone and building systems that are as delightful as they are capable, we’re interested in hearing from you. an opportunity to solve hard problems across hardware and software with a team focused on making robotics accessible and joyful to build. If you care about making robotics real for everyone and building systems that are as delightful as they are capable, we’re interested in hearing from you.
GB, MLN, Edinburgh
Do you want to make a real difference to real people's lives? Want to design and build fair and explainable systems which automate recruitment processes across Amazon? Come and be part of a team that develops new machine learning (ML) technologies, which help Amazon scale for its customers by recruiting diverse teams. Join our Recommendations team within Intelligent Talent Acquisition (ITA) where you’ll build machine learning products that transform how job seekers find opportunities and recruiters discover talent. You’ll develop sophisticated recommendation systems powering both Amazon Jobs and internal hiring platforms, operating at global scale to match the right people with the right positions. Using techniques including representation learning, reinforcement learning, and probabilistic modeling, your work will directly improve efficiency for recruiters and help candidates find their ideal roles. This position offers the chance to solve complex problems with significant impact by creating systems that make Amazon’s entire hiring ecosystem more effective while collaborating with scientists across the organization. Key job responsibilities - Design and implement machine learning models that power recommendation systems for job seekers and recruiters, ensuring high performance, scalability, and reliability at global scale. Our ideal candidate has a strong scientific foundation and experience of statistical analysis and model building and has a passion for fairness and explainability in ML systems. - Collaborate with engineers, scientists, and product managers to define requirements, create solutions, and deliver products that improve the hiring experience. - Participate in the full software development lifecycle including scoping, design, coding, testing, documentation, deployment, and maintenance of recommendation systems and ML models. - Solve complex ML problems using optimal data structures and algorithms, making thoughtful trade-offs between efficiency and maintainability. - Stay current with scientific literature and develop novel approaches that address business challenges in talent acquisition. You will have the opportunity to provide feedback on scientific work across the organization helping the entire Intelligent Talent Acquisition organization improve. A day in the life You might spend the morning reviewing a colleague’s code for a new recommendation algorithm feature, then collaborate with product managers to refine requirements for an upcoming enhancement. After lunch, you’ll dive into model development, analyzing performance metrics from recent A/B tests and implementing improvements to the job-seeker recommendation pipeline. Throughout the day, you’ll participate in scientific discussions with peers across the organization, providing valuable feedback while continuing to refine your expertise. About the team The Recommendations team is a hybrid group of software engineers and applied scientists located in Edinburgh. We build tools that match people to jobs and jobs to people, optimizing experiences for both recruiters and candidates. Our work directly impacts Amazon’s ability to find and hire exceptional talent globally. The team maintains a collaborative environment with regular knowledge sharing and mentorship opportunities. We work closely with our product teams to understand business needs and develop innovative scientific solutions that improve hiring outcomes across both industry and student requisitions worldwide.