Don't Mock Machine Learning Models In Unit Tests
How unit testing machine learning code differs from typical software practices
9 new today · 776 articles · from 22 blogs
How unit testing machine learning code differs from typical software practices
AI summaryMachine learning models that appear to perform well during development often fail on real-world data due to common pitfalls such as misleading data (hidden variables, spurious correlations, and labeling errors), data leakage (e.g., data-dependent preprocessing before splitting test data, look-ahead bias in forecasting, and iterative tuning against the test set), and inappropriate evaluation metrics. These mistakes have led to real-world failures, such as ineffective Covid prediction models, and have even contributed to a reproducibility crisis in science. The author recommends carefully inspecting what information models use for decisions, avoiding leaks throughout the ML pipeline, and adopting practices like the recently introduced REFORMS checklist for ML-based science.
Overcoming the bottleneck of human annotations in instruction-tuning, preference-tuning, and pretraining.
AI summaryThe article discusses how high-quality human-annotated data serves as the fuel for modern deep learning, including classification tasks and RLHF labeling for LLM alignment. While ML techniques can help improve data quality, human data collection fundamentally requires attention to detail and careful execution. Despite the community's awareness of the value of quality data, there remains a subtle tendency to prioritize model work over data work.
AI summaryThis article explains why ML models generate probabilistic, non-deterministic responses and how the sampling process works, including how logits are converted to probabilities via softmax. It covers key generation configuration variables—temperature (which redistributes probabilities to balance creativity vs. consistency), top-k (sampling from a fixed number of most likely values), and top-p or nucleus sampling (dynamically selecting values based on cumulative probability)—along with stopping conditions. It also introduces test time compute, a technique of generating multiple outputs and selecting the best one to improve model performance.
AI summaryThis article explores the pivotal role of deep learning in advancing single-cell sequencing (sc-seq) technologies, which enable researchers to analyze gene expression at the individual cell level and investigate cellular heterogeneity. It covers the background of genetic information flow (DNA to RNA to protein), the structure of single-cell sequencing data as matrices, and the evolution of sc-seq methods including single-cell RNA sequencing and spatially resolved transcriptomics. The article highlights that deep learning, particularly autoencoders, is well-suited for sc-seq data analysis due to its ability to handle high-dimensional data, capture non-linear relationships, and address cellular heterogeneity, surpassing traditional methods like PCA.
Some fundamental papers and a one-sentence summary for each; start your own paper club!
An expanded charter, lots of writing and speaking, and finally learning to snowboard.
Sending helpful & engaging pushes, filtering annoying pushes, and finding the frequency sweet spot.
AI summaryThe article describes the author's consulting experience on fish counting at large hydroelectric dams, where operators must comply with FERC regulations by demonstrating that their operations do not harm endangered fish populations, especially Pacific Northwest salmonids. Traditionally, fish counts are performed manually by trained observers—a physically demanding, error-prone process—prompting organizations to explore computer vision and human-in-the-loop machine learning systems to automate species identification and counting. Building such systems in a highly regulated industry involves negotiating the problem space, setting accuracy-based performance goals with stakeholders, and producing labeled training data, making fish counting a compelling example of a complex sociotechnical problem.
Answer.AI is a new kind of AI R&D lab which creates practical end-user products based on foundational research breakthroughs.
How to use open-source, permissive-use data and collect less labeled samples for our tasks.
AI summaryDespite significant investment in alignment techniques like RLHF to build safe default behavior into large language models, adversarial attacks and jailbreak prompts can still trigger undesired outputs. While most foundational adversarial attack research targets images in a continuous, high-dimensional space, attacks on discrete data like text are more challenging due to the lack of direct gradient signals. The author notes that attacking LLMs is essentially a form of controllable text generation, steering the model toward specific (unsafe) content.
The biggest deployment challenges, backward compatibility, multi-modality, and SF work ethic.
AI summaryThe article discusses neural algorithmic reasoning, the pursuit of capturing classical computation—such as shortest-path finding and dynamic programming—inside deep neural networks, motivated by the provable correctness, strong generalisation, and interpretability that classical algorithms possess but neural networks often lack. The author traces the emergence of 'algorithmic alignment' as a framework showing that architectures like graph neural networks (GNNs) naturally align with algorithms such as Bellman-Ford, and describes their own work on Neural Execution of Graph Algorithms (NEGA), which found that careful inductive biases—including a shared iterative processor, max aggregation, and step-wise supervision—let GNNs generalise to significantly larger, out-of-distribution inputs. The article concludes that this 'playing the alignment game' approach has yielded a successful line of specialised GNN solutions for learning to execute various algorithms, and that algorithmic alignment is developing into an increasingly rich theoretical field.
AI summaryThis article explains multimodality in machine learning, covering why working with multiple data types (text, images, audio) is essential for AI systems and how adding modalities to Large Language Models creates Large Multimodal Models (LMMs). It details the fundamentals of multimodal training through two foundational models—CLIP, which created a shared embedding space for text and images, and Flamingo, whose strong performance marked a breakthrough for LMMs. The article also surveys active research directions, including newer systems like BLIP-2 and LLaVA, adapters for more efficient multimodal training, and generating multimodal outputs.
Evals, retrieval-augmented generation, guardrails, and collecting feedback; all that good stuff.
AI summaryThis essay critiques mainstream AI safety discourse, arguing that alignment research at companies like OpenAI and Anthropic is driven by commercial incentives and has effectively become product development in disguise, using techniques like RLHF and RLAIF to make chatbots marketable rather than to genuinely mitigate long-term harms. The author contends that the 'intent alignment' framing is deceptively convenient—it sidesteps questions of whose values are being aligned and ignores bad actors—and that the field is ill-equipped to address concrete, present-day AI harms. Ultimately, the piece calls for the public discourse to distinguish speculative existential risks from real current dangers and to question whether profit-oriented labs can meaningfully solve alignment.
We’ve noticed an unusual training pattern in fine-tuning LLMs. At first we thought it’s a bug, but now we think it shows LLMs can learn effectively from a single example.
Reference, context, and preference-based metrics, self-consistency, and catching hallucinations.