Artificial intelligence engineering (AI engineering) is a technical discipline that focuses on the design, development, and deployment of AI systems. AI engineering involves applying engineering principles and methodologies to create scalable, efficient, and reliable AI-based solutions. It merges aspects of data engineering and software engineering to create real-world applications in diverse domains such as healthcare, finance, autonomous systems, and industrial automation. == Terminology ambiguity == According to Chip Huyen's book AI Engineering: Building Applications with Foundation Models, the term AI engineering refers to the process of building applications that use foundation models, which are typically models developed by a small number of research laboratories and made available as a service. Huyen distinguishes this from machine learning (ML) engineering, which involves building and deploying models developed in-house. She notes that most practical AI systems combine both approaches. For example, a customer-support chatbot may use a generative model to produce responses while also incorporating locally built components such as request classifiers or scoring mechanisms to assess response quality. As a result, the terms AI engineering and ML engineering are often used together or interchangeably in practice. The distinction and broader usage of the term have been discussed in industry publications and interviews, where AI engineering has been described as an emerging discipline focused on productionizing applications built with foundation models. == Key components == AI engineering integrates a variety of technical domains and practices, all of which are essential to building scalable, reliable, and ethical AI systems. === Data engineering and infrastructure === Data serves as the cornerstone of AI systems, necessitating careful engineering to ensure premium quality, wide spread availability, and usability. AI engineers gather large, diverse datasets from multiple sources such as databases, APIs, and real-time streams. This data undergoes cleaning, normalization, and preprocessing, often facilitated by automated data pipelines that manage extraction, transformation, and loading (ETL) processes. Efficient storage solutions, such as SQL (or NoSQL) databases and data lakes, must be selected based on data characteristics and use cases. Security measures, including encryption and access controls, are critical for protecting sensitive information and ensuring compliance with regulations like GDPR. Scalability is essential, frequently involving cloud services and distributed computing frameworks to handle growing data volumes effectively. === Algorithm selection and optimization === Selecting the appropriate algorithm is crucial for the success of any AI system. Engineers evaluate the problem (which could be classification or regression, for example) to determine the most suitable machine learning algorithm, including deep learning paradigms. Once an algorithm is chosen, optimizing it through hyperparameter tuning is essential to enhance efficiency and accuracy. Techniques such as grid search or Bayesian optimization are employed, and engineers often utilize parallelization to expedite training processes, particularly for large models and datasets. For existing models, techniques like transfer learning can be applied to adapt pre-trained models for specific tasks, reducing the time and resources needed for training. === Deep learning engineering === Deep learning is particularly important for tasks involving large and complex datasets. Engineers design neural network architectures tailored to specific applications, such as convolutional neural networks for visual tasks or recurrent neural networks for sequence-based tasks. Transfer learning, where pre-trained models are fine-tuned for specific use cases, helps streamline development and often enhances performance. Optimization for deployment in resource-constrained environments, such as mobile devices, involves techniques like pruning and quantization to minimize model size while maintaining performance. Engineers also mitigate data imbalance through augmentation and synthetic data generation, ensuring robust model performance across various classes. === Natural language processing === Natural language processing (NLP) is a crucial component of AI engineering, focused on enabling machines to understand and generate human language. The process begins with text preprocessing to prepare data for machine learning models. Recent advancements, particularly transformer-based models like BERT and GPT, have greatly improved the ability to understand context in language. AI engineers work on various NLP tasks, including sentiment analysis, machine translation, and information extraction. These tasks require sophisticated models that utilize attention mechanisms to enhance accuracy. Applications range from virtual assistants and chatbots to more specialized tasks like named-entity recognition (NER) and Part of speech (POS) tagging. === Reasoning and decision-making systems === Developing systems capable of reasoning and decision-making is a significant aspect of AI engineering. Whether starting from scratch or building on existing frameworks, engineers create solutions that operate on data or logical rules. Symbolic AI employs formal logic and predefined rules for inference, while probabilistic reasoning techniques like Bayesian networks help address uncertainty. These models are essential for applications in dynamic environments, such as autonomous vehicles, where real-time decision-making is critical. === Security === Security is a critical consideration in AI engineering, particularly as AI systems become increasingly integrated into sensitive and mission-critical applications. AI engineers implement robust security measures to protect models from adversarial attacks, such as evasion and poisoning, which can compromise system integrity and performance. Techniques such as adversarial training, where models are exposed to malicious inputs during development, help harden systems against these attacks. Additionally, securing the data used to train AI models is of paramount importance. Encryption, secure data storage, and access control mechanisms are employed to safeguard sensitive information from unauthorized access and breaches. AI systems also require constant monitoring to detect and mitigate vulnerabilities that may arise post-deployment. In high-stakes environments like autonomous systems and healthcare, engineers incorporate redundancy and fail-safe mechanisms to ensure that AI models continue to function correctly in the presence of security threats. === Ethics and compliance === As AI systems increasingly influence societal aspects, ethics and compliance are vital components of AI engineering. Engineers design models to mitigate risks such as data poisoning and ensure that AI systems adhere to legal frameworks, such as data protection regulations like GDPR. Privacy-preserving techniques, including data anonymization and differential privacy, are employed to safeguard personal information and ensure compliance with international standards. Ethical considerations focus on reducing bias in AI systems, preventing discrimination based on race, gender, or other protected characteristics. By developing fair and accountable AI solutions, engineers contribute to the creation of technologies that are both technically sound and socially responsible. == Workload == An AI engineer's workload revolves around the AI system's life cycle, which is a complex, multi-stage process. This process may involve building models from scratch or using pre-existing models through transfer learning, depending on the project's requirements. Each approach presents unique challenges and influences the time, resources, and technical decisions involved. === Problem definition and requirements analysis === Regardless of whether a model is built from scratch or based on a pre-existing model, the work begins with a clear understanding of the problem. The engineer must define the scope, understand the business context, and identify specific AI objectives that align with strategic goals. This stage includes consulting with stakeholders to establish key performance indicators (KPIs) and operational requirements. When developing a model from scratch, the engineer must also decide which algorithms are most suitable for the task. Conversely, when using a pre-trained model, the workload shifts toward evaluating existing models and selecting the one most aligned with the task. The use of pre-trained models often allows for a more targeted focus on fine-tuning, as opposed to designing an entirely new model architecture. === Data acquisition and preparation === Data acquisition and preparation are critical stages regardless of the development method chosen, as the performance of any AI system relies heavily on high-quality, re
Human visual system model
A human visual system model (HVS model) is used by image processing, video processing and computer vision experts to deal with biological and psychological processes that are not yet fully understood. Such a model is used to simplify the behaviors of what is a very complex system. As our knowledge of the true visual system improves, the model is updated. Psychovisual study is the study of the psychology of vision. The human visual system model can produce desired effects in perception and vision. Examples of using an HVS model include color television, lossy compression, and Cathode-ray tube (CRT) television. Originally, it was thought that color television required too high a bandwidth for the then available technology. Then it was noticed that the color resolution of the HVS was much lower than the brightness resolution; this allowed color to be squeezed into the signal by chroma subsampling. Another example is lossy image compression, like JPEG. Our HVS model says we cannot see high frequency detail, so in JPEG we can quantize these components without a perceptible loss of quality. Similar concepts are applied in audio compression, where sound frequencies inaudible to humans are band-stop filtered. Several HVS features are derived from evolution when we needed to defend ourselves or hunt for food. We often see demonstrations of HVS features when we are looking at optical illusions. == Block diagram of HVS == == Assumptions about the HVS == Low-pass filter characteristic (limited number of rods in human eye): see Mach bands Lack of color resolution (fewer cones in human eye than rods) Motion sensitivity More sensitive in peripheral vision Stronger than texture sensitivity, e.g. viewing a camouflaged animal Texture stronger than disparity – 3D depth resolution does not need to be so accurate Integral Face recognition (babies smile at faces) Depth inverted face looks normal (facial features overrule depth information) Upside down face with inverted mouth and eyes looks normal == Examples of taking advantage of an HVS model == Flicker frequency of film and television using persistence of vision to fool viewer into seeing a continuous image Interlaced television painting half images to give the impression of a higher flicker frequency Color television (chrominance at half resolution of luminance corresponding to proportions of rods and cones in eye) Image compression (difficult to see higher frequencies more harshly quantized) Motion estimation (use luminance and ignore color) Watermarking and Steganography
Minimum information standard
Minimum information standards are sets of guidelines and formats for reporting data derived by specific high-throughput methods. Their purpose is to ensure the data generated by these methods can be easily verified, analysed and interpreted by the wider scientific community. Ultimately, they facilitate the transfer of data from journal articles (unstructured data) into databases (structured data) in a form that enables data to be mined across multiple data sets. Minimal information standards are available for a vast variety of experiment types including microarray (MIAME), RNAseq (MINSEQE), metabolomics (MSI) and proteomics (MIAPE). Minimum information standards typically have two parts. Firstly, there is a set of reporting requirements – typically presented as a table or a checklist. Secondly, there is a data format. Information about an experiment needs to be converted into the appropriate data format for it to be submitted to the relevant database. In the case of MIAME, the data format is provided in spreadsheet format (MAGE-TAB). Some of the communities that maintain minimum information standards also provide tools to help experimental researchers to annotate their data. == MI Standards == The individual minimum information standards are brought by the communities of cross-disciplinary specialists focused on the problematic of the specific method used in experimental biology. The standards then provide specifications what information about the experiments (metadata) is crucial and important to be reported together with the resultant data to make it comprehensive. The need for this standardization is largely driven by the development of high-throughput experimental methods that provide tremendous amounts of data. The development of minimum information standards of different methods is since 2008 being harmonized by "Minimum Information about a Biomedical or Biological Investigation" (MIBBI) project. === MIAPPE, Minimum Information About a Plant Phenotyping Experiment === MIAPPE is an open, community driven project to harmonize data from plant phenotyping experiments. MIAPPE comprises both a conceptual checklist of metadata required to adequately describe a plant phenotyping experiment. === MIQE, Minimum Information for Publication of Quantitative Real-Time PCR Experiments === Published in 2009 these guidelines for the basis of requirements by many journals when submitting QPCR data, sadly they are not adhered to enough. === MIAME, gene expression microarray === Minimum Information About a Microarray Experiment (MIAME) describes the Minimum Information About a Microarray Experiment that is needed to enable the interpretation of the results of the experiment unambiguously and potentially to reproduce the experiment and is aimed at facilitating the dissemination of data from microarray experiments. It was published by the FGED Society in 2001 and was the first published minimum information standard for high-throughput experiments in the life sciences. MIAME contains a number of extensions to cover specific biological domains, including MIAME-env, MIAME-nut and MIAME-tox, covering environmental genomics, nutritional genomics and toxogenomics, respectively. === MINI: Minimum Information about a Neuroscience Investigation === ==== MINI: Electrophysiology ==== Electrophysiology is a technology used to study the electrical properties of biological cells and tissues. Electrophysiology typically involves the measurements of voltage change or electric current flow on a wide variety of scales from single ion channel proteins to whole tissues. This document is a single module, as part of the Minimum Information about a Neuroscience investigation (MINI) family of reporting guideline documents, produced by community consultation and continually available for public comment. A MINI module represents the minimum information that should be reported about a dataset to facilitate computational access and analysis to allow a reader to interpret and critically evaluate the processes performed and the conclusions reached, and to support their experimental corroboration. In practice a MINI module comprises a checklist of information that should be provided (for example about the protocols employed) when a data set is described for publication. The full specification of the MINI module can be found here. === MIARE, RNAi experiment === Minimum Information About an RNAi Experiment (MIARE) is a data reporting guideline which describes the minimum information that should be reported about an RNAi experiment to enable the unambiguous interpretation and reproduction of the results. === MIACA, cell based assay === Advances in genomics and functional genomics have enabled large-scale analyses of gene and protein function by means of high-throughput cell biological analyses. Thereby, cells in culture can be perturbed in vitro and the induced effects recorded and analyzed. Perturbations can be triggered in several ways, for instance with molecules (siRNAs, expression constructs, small chemical compounds, ligands for receptors, etc.), through environmental stresses (such as temperature shift, serum starvation, oxygen deprivation, etc.), or combinations thereof. The cellular responses to such perturbations are analyzed in order to identify molecular events in the biological processes addressed and understand biological principles. We propose the Minimum Information About a Cellular Assay (MIACA) for reporting a cellular assay, and CA-OM, the modular cellular assay object model, to facilitate exchange of data and accompanying information, and to compare and integrate data that originate from different, albeit complementary approaches, and to elucidate higher order principles. Documents describing MIACA are available and provide further information as well as the checklist of terms that should be reported. === MIAPE, proteomic experiments === The Minimum Information About a Proteomic Experiment documents describe information which should be given along with a proteomic experiment. The parent document describes the processes and principles underpinning the development of a series of domain specific documents which now cover all aspects of a MS-based proteomics workflow. === MIMIx, molecular interactions === This document has been developed and maintained by the Molecular Interaction worktrack of the HUPO-PSI (www.psidev.info) and describes the Minimum Information about a Molecular Interaction experiment. === MIAPAR, protein affinity reagents === The Minimum Information About a Protein Affinity Reagent has been developed and maintained by the Molecular Interaction worktrack of the HUPO-PSI (www.psidev.info)in conjunction with the HUPO Antibody Initiative and a European consortium of binder producers and seeks to encourage users to improve their description of binding reagents, such as antibodies, used in the process of protein identification. === MIABE, bioactive entities === The Minimum Information About a Bioactive Entity was produced by representatives from both large pharma and academia who are looking to improve the description of usually small molecules which bind to, and potentially modulate the activity of, specific targets in a living organism. This document encompasses drug-like molecules as well as herbicides, pesticides and food additives. It is primarily maintained through the EMBL-EBI Industry program (www.ebi.ac.uk/industry). === MIGS/MIMS, genome/metagenome sequences === This specification is being developed by the Genomic Standards Consortium === MIFlowCyt, flow cytometry === === Minimum Information about a Flow Cytometry Experiment === The Minimum Information about a Flow Cytometry Experiment (MIFlowCyt) is a standard related to flow cytometry which establishes criteria to record information on experimental overview, samples, instrumentation and data analysis. It promotes consistent annotation of clinical, biological and technical issues surrounding a flow cytometry experiment. === MINDR, dual gene expression reporters === Requires (1) reporting absolute values of reporter readouts, (2) list of positive and negative controls, and (3) sequences of all reporter constructs. === MISFISHIE, In Situ Hybridization and Immunohistochemistry Experiments === === MIAPA, Phylogenetic Analysis === Criteria for Minimum Information About a Phylogenetic Analysis were described in 2006. === MIRAGE, Glycomics === The MIRAGE project is supported and coordinated by the Beilstein-Institut to establish guidelines for data handling and processing in glycomics research [1] === MIAO, ORF === === MIAMET, METabolomics experiment === === MIAFGE, Functional Genomics Experiment === === MIRIAM, Minimum Information Required in the Annotation of Models === The Minimal Information Required In the Annotation of Models (MIRIAM), is a set of rules for the curation and annotation of quantitative models of biological systems. === MIASE, Minimum Information About a Simulation Experiment =
Marco Camisani Calzolari
Marco Camisani Calzolari (born March 1969) is an Italian British university professor, author, and television personality specializing in digital communications, transformation, and artificial intelligence. He advises the Italian government and police on ethical AI and digital safety and hosts the digital segment of the Italian news show Striscia la Notizia. His research gained international attention in 2012 after creating an algorithm claiming to identify real Twitter users from fake users of bots. Marco Camisani Calzolari was awarded as an Honorary Police Officer by the Italian State Police and the Knight of the Italian Republic. == Biography == Camisani Calzolari was born in Milan, Italy where he began his television career, hosting on local provider LA7 in (2001). In 2008 Camisani Calzolari moved to the UK where he founded multiple digital start-ups. He is now a naturalised British citizen and applied to become a "Freeman of the City" in June 2022. In 2024, Marco Camisani Calzolari began serving as the Chair and Adjunct Professor of the elective course Cyber-Humanities within the Degree Programme in Medicine and Surgery at Università Vita-Salute S.Raffaele in Milan. On the 14th of May 2024, Camisani Calzolari was awarded the Knight of the Italian Republic (Order of the Star of Italy). In 2024, Marco Camisani Calzolari was awarded the title of Honorary Police Officer by the Italian State Police for his commitment to combating cybercrime and promoting digital security. He also received the Keynes Sraffa Award 2024 from the Italian Chamber of Commerce and Industry for the UK. Additionally, he was honored with the University Seal by Università degli Studi della Tuscia (Viterbo) for his efforts in disseminating knowledge both in Italy and abroad. == Academic career == Camisani Calzolari began his academic career at the Università Statale di Milano in 2007, until chairing a course on Corporate Communication and Digital Languages at the IULM University of Milan between 2007 and 2010. During this time Camisani Calzolari published his first written work under the title 'Impresa 4.0'. After moving to London, Camisani Calzolari focussed on digital start-ups including 'Digitalevaluation ltd' where he would publish the results of his Twitter algorithm study. Following its publication, he accepted a role as Affiliate Practitioner at the Centre for Culture Media & Regulation (CCMR), University of Brunel London, and subsequently another role at a British University as Lecturer in Digital Communication at the LCA Business School. Camisani Calzolari returned to Italy to lecture on Interactive Digital Communication at the University of Milan. From 2017 to 2023, he held various roles at the European University of Rome, including Adjunct Professor and Chair in Digital Communication, and published The Fake News Bible in 2018. In 2024 he became the Scientific Coordinator for a Master's program at Università San Raffaele in Milan. === Twitter fake followers study === In 2012, Camisani Calzolari's research came into the focus of the public eye following the publication of his findings in a study analysing the followers of high-profile public figures and corporations. He developed a computer algorithm claiming to be able to distinguish real followers from computer-generated "bots". The algorithm compiled data correlative of human activity such as having a name, image, physical address, using punctuation and cross-account activity. Genuine Twitter users were considered to have written at least 50 posts and possessed over 30 followers themselves. The findings led to scrutiny of several individuals and corporations for allegedly purchasing followers. === Publications === Camisani Calzolari is best for known for his work in improving accessibility to digital and tech solutions for everyday business and personal use. His work in digital and communications has been included in several publications including: Cyberhumanism (2023) The Fake News Bible (2018), First Digital Aid for Business (2015), The Digital World (2013), Escape from Facebook (2012), Enterprise 4.0. Camisani Calzolari was also the subject of a University College London (UCL) case study titled Marco Camisani-Calzolari: the Digital Renaissance Man. == Government work == Since 2023, he is a member of the Coordination Committee on Artificial Intelligence at the Presidency of the Council of Ministers and an advisor in Digital Skills and Designer of initiatives for the Department for Digital Transformation. He also serves as the official spokesperson for the State Police, educating the public on preventing digital threats, avoiding digital scams, and explaining criminal case. Since August 2024, Marco Camisani Calzolari has served as an expert for the Italian Agency for the National Cybersecurity (ACN). In October of the same year, he also became a member of the General-Purpose AI Code of Practice working group for the European Commission. == Television work == Camisani Calzolari hosts a digital segment for Striscia la Notizia, an Italian satirical television program on the Mediaset-controlled Canale 5. He presented on weekly segments that include: RAI 1 – Digital First Aid (TV Program – 2014 to 2017) in the program "Uno Mattina" as a digital expert; RTL 102.5 – Technology Space (Radio Program – 2012 to 2017) in the morning news program as a digital expert (100 episodes from 2012 to 2017); DIGITALK Talkshow (2004) as host of Digitalk; Misterweb (TV Program – 2001 to 2002), he presented the TV program “MisterWeb”, on "LA7". Marco Camisani Calzolari was a testimonial for several institutional communication campaigns by the Italian Department of Digital Transformation. These include initiatives promoting the Punti Digitale Facile, raising awareness about the NIS2 Directive for cybersecurity, and advocating for the adoption of the Electronic Identity Card (CIE).
METR
Model Evaluation and Threat Research (METR) (MEE-tər), is a nonprofit research institute, based in Berkeley, California, that evaluates frontier AI models' capabilities to carry out long-horizon, agentic tasks that some researchers argue could pose catastrophic risks to society. METR has worked with leading AI companies to conduct pre-deployment model evaluations and contribute to system cards, including OpenAI's o3, o4-mini, GPT-4o and GPT-4.5, and Anthropic's Claude models. METR's CEO and founder is Beth Barnes, a former alignment researcher at OpenAI who left in 2022 to form ARC Evals, the evaluation division of Paul Christiano's Alignment Research Center. In December 2023, ARC Evals was spun off into an independent 501(c)(3) nonprofit and renamed METR. == Research == A substantial amount of METR's research is focused on evaluating the capabilities of AI systems to conduct research and development of AI systems themselves, including RE-Bench, a benchmark designed to test whether AIs can "solve research engineering tasks and accelerate AI R&D". === Doubling time estimates === In March 2025, METR published a paper noting that the length of software engineering tasks that the leading AI model could complete had a doubling time of around 7 months between 2019 and 2024. In January 2026, METR released a new version of their time horizon estimates model (Time Horizon 1.1). According to the updated model, the rate of progress of AI capabilities has increased since 2023, with a post-2023 doubling time estimated at 130.8 days (4.3 months). Progress is thus estimated to be 20% more rapid. === Time horizon measurements === METR releases a "task-completion time horizon" for analysed AI models. This measures the "task duration (measured by human expert completion time) at which an AI agent is predicted to succeed with a given level of reliability." The metric is reported in two variants: the 50%-time horizon, which gives the task duration at which an AI model is estimated to succeed 50% of the time, and the 80%-time horizon, which gives the task duration at which an AI model is estimated to succeed 80% of the time. METR has published two versions of the underlying model: Time Horizon 1.0 and Time Horizon 1.1, the latter introduced in January 2026. As of 9 May 2026, the best-performing model is Claude Mythos, with a 50%-time horizon of likely at least 16 hours and an 80%-time horizon of 3 hours and 6 minutes. METR notes that "[m]easurements above 16 [hours] are unreliable with [their] current task suite". The following table provides time horizon estimates ordered by each model's release date:
Human visual system model
A human visual system model (HVS model) is used by image processing, video processing and computer vision experts to deal with biological and psychological processes that are not yet fully understood. Such a model is used to simplify the behaviors of what is a very complex system. As our knowledge of the true visual system improves, the model is updated. Psychovisual study is the study of the psychology of vision. The human visual system model can produce desired effects in perception and vision. Examples of using an HVS model include color television, lossy compression, and Cathode-ray tube (CRT) television. Originally, it was thought that color television required too high a bandwidth for the then available technology. Then it was noticed that the color resolution of the HVS was much lower than the brightness resolution; this allowed color to be squeezed into the signal by chroma subsampling. Another example is lossy image compression, like JPEG. Our HVS model says we cannot see high frequency detail, so in JPEG we can quantize these components without a perceptible loss of quality. Similar concepts are applied in audio compression, where sound frequencies inaudible to humans are band-stop filtered. Several HVS features are derived from evolution when we needed to defend ourselves or hunt for food. We often see demonstrations of HVS features when we are looking at optical illusions. == Block diagram of HVS == == Assumptions about the HVS == Low-pass filter characteristic (limited number of rods in human eye): see Mach bands Lack of color resolution (fewer cones in human eye than rods) Motion sensitivity More sensitive in peripheral vision Stronger than texture sensitivity, e.g. viewing a camouflaged animal Texture stronger than disparity – 3D depth resolution does not need to be so accurate Integral Face recognition (babies smile at faces) Depth inverted face looks normal (facial features overrule depth information) Upside down face with inverted mouth and eyes looks normal == Examples of taking advantage of an HVS model == Flicker frequency of film and television using persistence of vision to fool viewer into seeing a continuous image Interlaced television painting half images to give the impression of a higher flicker frequency Color television (chrominance at half resolution of luminance corresponding to proportions of rods and cones in eye) Image compression (difficult to see higher frequencies more harshly quantized) Motion estimation (use luminance and ignore color) Watermarking and Steganography
Linde–Buzo–Gray algorithm
The Linde–Buzo–Gray algorithm (named after its creators Yoseph Linde, Andrés Buzo and Robert M. Gray, who designed it in 1980) is an iterative vector quantization algorithm to improve a small set of vectors (codebook) to represent a larger set of vectors (training set), such that it will be locally optimal. It combines Lloyd's Algorithm with a splitting technique in which larger codebooks are built from smaller codebooks by splitting each code vector in two. The core idea of the algorithm is that by splitting the codebook such that all code vectors from the previous codebook are present, the new codebook must be as good as the previous one or better. == Description == The Linde–Buzo–Gray algorithm may be implemented as follows: algorithm linde-buzo-gray is input: set of training vectors training, codebook to improve old-codebook output: codebook that is twice the size and better or as good as old-codebook new-codebook ← {} for each old-codevector in old-codebook do insert old-codevector into new-codebook insert old-codevector + 𝜖 into new-codebook where 𝜖 is a small vector return lloyd(new-codebook, training) algorithm lloyd is input: codebook to improve, set of training vectors training output: improved codebook do previous-codebook ← codebook clusters ← divide training into |codebook| clusters, where each cluster contains all vectors in training who are best represented by the corresponding vector in codebook for each cluster cluster in clusters do the corresponding code vector in codebook ← the centroid of all training vectors in cluster while difference in error representing training between codebook and previous-codebook > 𝜖 return codebook