Reading AI Research and Running Fair Experiments

Updated · 7 min read
hardPython 3.13airesearchexperimentsbaselinesreproducibilityablation

Reading AI research means checking what a claim actually rests on: the problem, the data, the baseline, the metric, the result and the limits. Running a fair experiment means doing the same in your own work: compare against sensible baselines, repeat runs with several random seeds, change one thing at a time (ablations), and report the spread, not just the best number. These habits separate real progress from luck, cherry-picking and marketing.

How to Read a Paper or Claim

PartQuestions to ask
ProblemWhat exactly is being solved, and for whom?
MethodWhat is new, and what was reused?
DataWhere did it come from? Could test examples have leaked into training (contamination)?
BaselineIt is used to show the gain is real: compared with what, and was the baseline tuned as carefully?
MetricDoes it measure what matters for the task?
ResultHow big is the gain, and how much does it vary across runs?
AblationsWhich parts of the method actually cause the gain?
LimitsWhat does the paper say doesn't work, and what did it not test?

Also ask who is making the claim: a peer-reviewed paper, a vendor announcement and an independently reproduced result carry very different weight. Reproduction reruns the same code and data; replication gets the same finding with new data or a new implementation.

Example: A Fair Experiment

This program compares a small neural network on the handwritten digits from "Training a Network in PyTorch" with two baselines, runs everything with 5 seeds, and tests two variations.

Baselines, seeds and ablations: is the gain real, and where does it come from?
Python
import warnings
 
import numpy as np
from sklearn.datasets import load_digits
from sklearn.dummy import DummyClassifier
from sklearn.exceptions import ConvergenceWarning
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
 
warnings.filterwarnings("ignore", category=ConvergenceWarning)
digits = load_digits()
X_train, X_test, y_train, y_test = train_test_split(digits.data / 16, digits.target, test_size=0.25,
                                                    random_state=42, stratify=digits.target)
 
def score(make, seeds=range(5)):
    """Run the same experiment with 5 seeds: report the mean and the spread, not one lucky number."""
    s = [make(seed).fit(X_train, y_train).score(X_test, y_test) for seed in seeds]
    return np.mean(s), np.std(s), min(s), max(s)
 
experiments = {
    "baseline: most frequent class": lambda seed: DummyClassifier(strategy="most_frequent"),
    "baseline: logistic regression": lambda seed: LogisticRegression(max_iter=2000),
    "MLP, 32 hidden units": lambda seed: MLPClassifier((32,), max_iter=200, random_state=seed),
    "ablation: 4 hidden units": lambda seed: MLPClassifier((4,), max_iter=200, random_state=seed),
    "variation: 20 epochs, not 200": lambda seed: MLPClassifier((32,), max_iter=20, random_state=seed),
}
print(f"{'experiment':32}{'mean':>7}{'± sd':>7}{'min':>8}{'max':>8}")
for name, make in experiments.items():
    mean, sd, lo, hi = score(make)
    print(f"{name:32}{mean:7.1%}{sd:7.1%}{lo:8.1%}{hi:8.1%}")
 
one = [MLPClassifier((32,), max_iter=200, random_state=s).fit(X_train, y_train).score(X_test, y_test) for s in range(20)]
print(f"\n20 seeds of the same MLP: best {max(one):.1%}, worst {min(one):.1%}. Reporting only the best seed would overstate it.")
Output
experiment                         mean   ± sd     min     max
baseline: most frequent class     10.2%   0.0%   10.2%   10.2%
baseline: logistic regression     96.2%   0.0%   96.2%   96.2%
MLP, 32 hidden units              97.6%   0.4%   97.1%   98.0%
ablation: 4 hidden units          80.0%   3.7%   74.9%   84.4%
variation: 20 epochs, not 200     85.1%   1.6%   82.0%   86.4%
 
20 seeds of the same MLP: best 98.2%, worst 96.9%. Reporting only the best seed would overstate it.

Explanation:

ExperimentMeanSpreadWhat it shows
Most frequent class10.2%0.0%The floor: guessing the commonest digit
Logistic regression96.2%0.0%A simple, strong baseline
MLP, 32 hidden units97.6%±0.4%The method: 1.4 points better than the baseline
Ablation: 4 hidden units80.0%±3.7%The hidden layer's size matters a lot
20 epochs, not 20085.1%±1.6%Training length matters too
  • The simple baseline is strong. The neural network beats logistic regression by 1.4 points, not by the 87 points it beats the guessing floor. Comparing only against a weak baseline makes any method look impressive.
  • Seeds matter. The same network across 20 seeds ranges from 96.9% to 98.2%. Reporting only the best seed would overstate the result, and a "gain" smaller than this spread may be luck.
  • Ablations explain the result: shrinking the hidden layer or cutting training shows which ingredients carry the performance.
  • Deterministic models like logistic regression show 0.0% spread; the variance comes from random initialization and shuffling in the network.

Statistical vs Practical Significance

A difference can be statistically reliable but too small to matter, or large but too uncertain to trust. With small evaluation sets, use intervals, as in "Measuring RAG and Agents Properly". Then ask whether the gain is worth its cost: a model that is 0.5 points better but four times slower may not be an improvement for your users.

Recording an Experiment

RecordExample
Code versionThe commit or file used
Data versionA fingerprint, as in "Data Pipelines for AI"
EnvironmentPython and library versions, hardware
ConfigurationEvery setting, including seeds
ResultsAll runs, not only the best; failures and negative results too

Common Mistakes

Comparing with a weak or untuned baseline. The gain looks bigger than it is.

Reporting the best seed. Report the mean and spread.

Changing several things at once. You can't tell which change helped.

Hiding negative results. They save others from repeating the same dead end.

Interview Corner

How would you check whether a new model is really better?

Compare it with strong, equally tuned baselines on the same data, run several seeds and report the mean and spread, run ablations to see which parts matter, and check that the gain is larger than the variation and worth its cost.

What is an ablation study?

Removing or changing one component at a time to measure how much it contributes. In this lesson, cutting the hidden layer from 32 to 4 units dropped accuracy from 97.6% to 80.0%.

Practice

Exercise: another baseline. Add KNeighborsClassifier(n_neighbors=3) from "K-Nearest Neighbors and SVMs" as a baseline. How does it compare with the MLP, and would you still recommend the network?

Check your understanding:

  1. Why does beating the 10.2% baseline prove little?
  2. What did the 20-seed run show?
  3. What is the difference between reproduction and replication?

Quick check: research and experiments

4 questions
1How much better was the MLP than logistic regression?
2What was the range across 20 seeds of the same MLP?
3What does an ablation do?
4Which claim carries the most weight?

Key Takeaways

Quick reference

NeedPractice
Fair comparisonStrong, equally tuned baselines on the same split
VariationSeveral seeds; report mean and spread
CauseAblations, one change at a time
TrustReproduced or replicated results over announcements
RecordsCode, data fingerprint, environment, config, all results

Was this tutorial helpful?

Lesson 133 of 186