1 of 80

10-605 / 10-805

Machine Learning from Large Datasets

2 of 80

Announcements

  • Wednesday 11/25: no class 🦃
  • Monday 11/30: review lecture
    • no new material
  • Wed 12/2: exam 2
  • Sun 12/6:
    • final miniproject deliverable

3 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

4 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

5 of 80

ALL-REDUCE

6 of 80

Recap

  • Common pattern:
    • do some learning in parallel
    • aggregate local changes from each processor
      • to shared parameters
    • distribute the new shared parameters
      • back to each processor

​

​

    • and repeat….

​

MAP

ALLREDUCE

7 of 80

Recap

Tree AllReduce is used for MapReduce clusters

​

  • implemented in MPI, e.g., in VW code (John Langford) in a Hadoop/compatible scheme

​

8 of 80

AllReduce on TPU/GPU clusters

  • Problem: implement AllReduce with
    • Large parameter vectors
    • A mix of slow/fast connections between workers
      • Eg Viperfish TPU topology (v5)
  • Common solution: variants of Ring AllReduce
    • Sometimes on a 3D Torus

9 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

10 of 80

OPTIMIZING FID

11 of 80

Fusion in Decoder (FiD)

2021

12 of 80

Recap: Fusion in Decoder (FiD)

FLOP analysis: Encoder is 6x as expensive as decoder!

…but at inference time decoding is slowest. Why?

13 of 80

Recap: Performance analysis

Encoder / prefilling: batched MHA with batches of different positions in a sequence

Memory:

​

O(bnd) +

O(bhn2) +

O(d2)

…because

​

X,M,Q,K,V,O,Y

logits, weights

P’s

FLOPS: O(bnd2)

Claim: FLOPs/sec <= FLOPs/byte * bytes/sec

 

moving data from HBM to Matmul units is “slow”

This is nice and low!

14 of 80

Recap: Performance analysis

Decoding: extend KY cache K and V

construct the query q for x

compute new keys and values and

update key-value cache

attn-weighted sum of values

project back to dimension of x

 

More memory transfer

Less compute

This is not small if n is large … which it is for RAG/FiD

15 of 80

Recap: Fusion in Decoder (FiD)

FLOP analysis: Encoder is 6x as expensive as decoder!

…but at inference time decoding is slowest. Why?

What’s the fix?

Predicted by counting FLOPS for all the matmuls and assuming nt << ns and nt << d

  • nt tokens in decoder output
  • ns tokens in all encoder input

Predicted by memory/FLOPs bottleneck

16 of 80

Recap: Fusion in Decoder Optimized (FiDO)

  • Speeding up performance:
    • Layer sparse attention (LSA): perform cross attention only on every K-th layer (K=6)
      • Load fewer key-value entries from encoder on avg
    • Multi-query attention (MQ)
      • Creates fewer key-value entries
  • Compensate for performance loss:
    • Scale the decoder up!
      • Use T5-XL decoder with T5-Base encoder, etc

Encoder change: Decoder needs fewer KV cache entries

Encoder change: Decoder needs fewer KV cache entries

Decoder can afford to be bigger!

17 of 80

Recap: Fusion in Decoder Optimized (FiDO)

18 of 80

Recap: LUMEN: FiD with caching

The first N-K layers of the FiD encoder

The last K layers of the FiD encoder

FiD decoder

Passages are encoded with first N-K layers and stored off-line for every document

19 of 80

Recap: LUMEN: FiD with caching

Using 2/3 offline and 1/3 live is better than doing everything off-line

20 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

21 of 80

“FID” WITH DECODER-ONLY LLMS

22 of 80

Main ideas in FiD and extensions

  • In encoder
    • cross-encoder q+p1, q+p2, … separately
      • restricting cross-attention
  • In decoder
    • attend to everything as you generate
  • Extensions
    • FiDO: optimize performance to avoid decoder bottlenecks
    • LUMEN: pre-compute encoder outputs

Parallel Context Windows (PCW) - 2023

TurboRAG, Blockwise Sparse Attention - 2024

Dynamic Blockwise Sparse Attention - 2025

Analog for decoder-only LLMs

23 of 80

2023

  • Context tokens: retrieved document(s) for RAG, in-context examples, …
  • Task tokens: question for RAG, test input for ICL, …
    • I believe also output tokens are task tokens

​

Key idea: cross-attend within a context window, and cross-attend between task tokens and all context windows.

Very similar to FiD

  • if question/answer are task tokens
  • no post-training required

Implemented with attention masks rather than parallel generation of keys and values

24 of 80

2023

  • Context tokens: retrieved document(s) for RAG, in-context examples, …
  • Task tokens: question for RAG, test input for ICL, …
    • I believe also output tokens are task tokens

​

Key idea: cross-attend within a context window, and cross-attend between task tokens and all context windows.

Very similar to FiD

  • if question/answer are task tokens

Good results for NQ (vs conventional RAG system) and ICL (especially classification with many classes)

Implemented with attention masks rather than parallel generation of keys and values

25 of 80

2023

  • Context tokens: retrieved document(s) for RAG
  • Task tokens: question for RAG

​

Key idea: cross-attend within a context window, and cross-attend between task tokens and all context windows.

2024

New idea:

  • cache independently-produced KV pairs of the documents
  • load KV pairs for relevant docs directly
  • fine-tune for a short time (100-1000 steps)

A little like LUMEN

26 of 80

2025

Key idea: same as Block-Attention except

  • experiments are on ICL instead of RAG
  • they also cache the independently-produced KV pairs of the documents
  • evaluate addition of KV pairs computed for retrieved documents
    • retrieve ICL examples with BM25
  • avoid fine-tuning
    • clever use of StreamingLLM trick of “attention sink”
    • don’t mess with position encodings

27 of 80

DBSA: Details

Baseline: many-shot learning

  • Given n ICL examples
    • encode n/k blocks of ICL examples containing
      • k demonstrations
      • a shared “anchor block”
    • load all blocks into a KV cache
    • add the usual positional encoding features
  • Implemented with FlexAttention
    • Doesn’t actually encode the masked blocks

​

  • 50 examples/block, 30k and 90k training examples for classification tasks

​

​

Dynamic example selection

  • Given a query q*
    • retrieve m<n encoded blocks (with BM25)
    • load retrieved blocks and anchor block into a KV cache and add positional encoding

28 of 80

DBSA: Results

29 of 80

Main ideas in FiD and extensions

  • In encoder
    • cross-encoder q+p1, q+p2, … separately
      • restricting cross-attention
  • In decoder
    • attend to everything as you generate
  • Extensions
    • FiDO: optimize performance to avoid decoder bottlenecks
    • LUMEN: pre-compute encoder outputs

Parallel Context Windows (PCW) - 2023

TurboRAG, Blockwise Sparse Attention - 2024

Dynamic Blockwise Sparse Attention - 2025

Analog for decoder-only LLMs

Work with Ingesting-Text-as-KV Cache continues…

30 of 80

31 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

32 of 80

SCALABLE EVALUATION

33 of 80

Recap: Leo’s talk

34 of 80

GenAI has changed how we evaluate ML

Who was the ICML general chair in 2008?

William Cohen

✅

35 of 80

GenAI has changed how we evaluate ML

???

36 of 80

GenAI has changed how we evaluate ML

  • Pre-GenAI
    • ML systems were used for classification, regression, extraction from documents, …
    • the quality of an output (and a model) was easy to evaluate automatically
  • GenAI
    • system outputs often require care and effort to evaluate
      • good manual labels are expensive!
    • how can we scale up the evaluation of models?

​

37 of 80

Scalable Evaluation: AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

NeurIPS 2024

“We provide the first empirical evidence of LLM judges exhibiting significant bias towards LLM-based rankers. Furthermore, we observe limitations in LLM judges’ ability to discern subtle system performance differences… “ - Balog et al

38 of 80

Scalable Evaluation: AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

39 of 80

Nov 21, 2026

“Nuggets”

facts relevant to each answer

RAG system

RAG system

judge

✅

40 of 80

Scalable Evaluation: AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

Arguments for:

  • much more data can be collected faster
  • my project is late / over budget
  • human labels are noisy
  • LLM-as-judge biases seem to be minor

​

​

“We provide the first empirical evidence of LLM judges exhibiting significant bias (statistically significant? but is it large?) towards LLM-based rankers…. we observe limitations in LLM judges’ ability to discern subtle system performance differences… “ - Balog et al

Argument against: ML/GenAI systems are interconnected

  • We generate data for ML with GenAI (data augmentation)
  • We evaluate ML systems with GenAI
  • We pre-train ML systems on ML-filtered text
  • We pre-train ML systems on GenAI-produced text
  • Long-term, will subtle biases have subtle effects? or large effects?

​

​

​

​

​

41 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

42 of 80

✅

43 of 80

44 of 80

Information In Networks Is Weird

  • Example: Making decisions with data about other people’s choices as an input
    • Picking a crowded restaurant in a new city, instead of an empty one
      • You have little information about the food quality
      • But all those people can’t be wrong…?
    • Picking a popular course instead of a smaller one
    • …

45 of 80

Information In Networks Is Weird

  • Simple example [Easley & Kleinberg]:
    • An urn with a 50/50 chance of having:
      • 2/3 red balls and 1/3 green balls; or
      • 1/3 red balls and 2/3 green balls
    • An experiment: in each trial t=1,2,…
      • Student t will
        • sample one ball (and then replaces it)
        • guess what’s the majority class (red or green)
    • Everyone that guesses right gets a payoff
    • Nobody can change their guesses

private

public

Networks, Crowds, and Markets, 2010

46 of 80

Making decisions with other people’s choices as an input

  • Possible outcome:
    1. A red ball: the guess is red
    2. A red ball: the guess is red
    3. A green ball: the guess is ___ ?
    4. A green ball: the guess is ___ ?

​

P(Rational sequential decision-making leads to a cascade) >= 1/9

 

 

 

red

47 of 80

Making decisions with other people’s choices as an input

  • Artificial music market
    • 48 unknown songs, 14k participants
      • Participants listen, rate, and (maybe) download
    • Experiment 1:
      • “Independent world”: choose songs from a grid
      • “Social world” (x8): also see #prior downloads of others (weak signal)
    • Experiment 2:
      • “Independent world”: choose songs from a list
      • “Social world” (x8): list sorted by #prior downloads (stronger signal)
  • Results: based on average differences in market share
    • Inequality: compare different songs in same “world”
    • Unpredictability: compare same songs in different “worlds”

​

​

​

[Salganic, Dodds, Watts – Science 2006]

48 of 80

Making decisions with other people’s choices as an input

[Salganic, Dodds, Watts – Science 2006]

More social influence 🡺 More skewed distributions of success

weak signal

strong signal

49 of 80

Making decisions with other people’s choices as an input

[Salganic, Dodds, Watts – Science 2006]

More social influence 🡺 Less predictable which songs are successful

weak signal

strong signal

small preferences can lead to large changes in distribution

50 of 80

Scalable Evaluation: AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

Arguments for:

  • much more data can be collected faster
  • my project is late / over budget
  • human labels are noisy
  • LLM-as-judge biases seem to be minor

​

​

Argument against: ML/GenAI systems are interconnected

  • We generate data for ML with GenAI (data augmentation)
  • We evaluate ML systems with GenAI
  • We pre-train ML systems on ML-filtered text
  • We pre-train ML systems on GenAI-produced text
  • Long-term, will subtle biases have subtle effects? or large effects?

​

​

​

​

​

No idea but large effects are definitely possible

51 of 80

Recap: Leo’s talk

LLMs rate, humans confirm

52 of 80

PPI: Statistically Unbiased AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

Arguments for:

  • much more data can be collected faster
  • my project is late / over budget
  • human labels are noisy
  • LLM-as-judge biases seem to be minor

​

​

  • A small amount of human-labeled data can be used to correct for biases in a judge/autorater
  • statistical inference 🡺 prediction-powered inference

53 of 80

Outline

  • Catchup and recaps
    • Ring All-Reduce
    • Fusion-in-Decoder (FiD)
    • FiD-like approaches for decoder-only LLMs
  • Scalable evaluation
    • Why evals have gotten hard
    • LLMs-as-a-judge and preferences in networks
    • Prediction-Powered Inference (PPI)

54 of 80

PREDICTION POWERED INFERENCE

55 of 80

PPI: Statistically Unbiased AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

See also: double robust estimators, difference estimates, …

56 of 80

PPI: Statistically Unbiased AI Judges

  • A simple example: human labels to estimate the probability of some binary property of a generation
  • Examples
    • No factual errors
    • No image of a human non-celebrity
    • Some citation is from a low-quality source
    • …

​

100 simulated labels

10 similar simulated labelings

blue and red: 95% confidence interval

🡺 hill-climbing with small data is difficult

57 of 80

PPI: Statistically Unbiased AI Judges

same 100 simulated labels

5000 autorated labels: 2% FP and 18% FN

unequal FP and FN 🡺 autorater is biased

PPI combination of 10,000 biased autorater labels and 100 unbiased human labels. PPI lo and hi CI are solid lines, human labels alone are dotted

For PPI, true mean is in CI 95% of the time

58 of 80

PPI: Statistically Unbiased AI Judges

PPI combination of 10,000 biased autorater labels and 100 unbiased human labels. PPI lo and hi CI are solid lines, human labels alone are dotted

For PPI, true mean is in CI 95% of the time

Adding human labels until the human CI is the same width is the same as the PPI’s CI width.

PPI + 100 labels = 270 human labels

PI lets you scale impact of human labels by nearly 3x!

59 of 80

2024

Machinery we developed:

Tools to do Monte Carlo Integration over combinations of common posteriors for means and proportions

Used these to explore old and new methods for PPI…

60 of 80

Bayesian PPI

Difference estimate

(old)

Bayesian PPI version

61 of 80

PPI Visualization

g = μ1 + μ2   

​

μ1 = 1⁄N Σj f(x̃j)

​

μ2 = 1⁄n Σi (yi − f(xi))

​

general rule: combine….

​

“covariates”: from unlabeled data

​

“rectifier”: from labeled data

​

62 of 80

2024

Machinery we developed:

Tools to do Monte Carlo Integration over combinations of common posteriors for means and proportions

Used these to explore old and new methods for PPI…

63 of 80

A practical problem with autoraters

ML models tend to hedge too much—put more weight in the middle of the distribution

mean y - f

mean y - f

64 of 80

A practical problem with autoraters

ML models tend to hedge too much—put more weight in the middle of the distribution

Solution: split the data by autorater score and use two difference estimates

mean y - f

mean y - f

65 of 80

Bayesian PPI for multiple “strata”

Stratified distance estimate: divide data intro ”strata” and do Bayesian PPI separately in each strata

=

Stratified sampling: separately sample disjoint “strata” of a population (e.g., college degrees vs no-college degrees) and combine estimates in each strata

Lowers variance if individual strata have low variance

need to learn a slightly more complex rectifier

66 of 80

Bayesian PPI: Results

SeaHorse: multilingual genAI labeling tasks

AQA: attributed question answering task

67 of 80

Background: Power Tuning for Difference Estimates

Difference estimate

(old)

Generalization (PPI++)

works for any λ, there is a good heuristic for setting it using cov of SN and Sn

λ=1 gives PPI

λ=0 gives classical statistic

68 of 80

PREDICTION POWERED INFERENCE:�RECENT WORK

69 of 80

70 of 80

NeurIPS 2024

71 of 80

Stratified PPI paper: Summary

  • Change 1: use a standard frequentist analysis
    • Establish confidence intervals instead of credible intervals
  • Change 2: only evaluate the stratified variant of PPI
  • Change 3: combine with recent results on active statistical inference (Zrnic and Candès, ICML 2024):
    • Analysis of which human labels should be collected for PPI tests
    • Short story: weight each label by Pr(collected), where

​

​

    • We approximate this to pick #human labels/strata

 

uncertainty sampling

72 of 80

Stratified PPI Results

sample by wk

σk wk

simple active learning combined with the stratified rectifier

73 of 80

Multiple Prediction-Powered Inference

​

Charlie Cowen-Breen

​

Adam Fisch

Jacob Eisenstein

Alekh Agarwal

Amir Globerson

William Cohen

ICLR 2026

74 of 80

MultiPPI

  • More general setting:
    • k correlated statistics (human, autorater, …):
      • X1 , X2 , …, Xk
    • Compute some linear combination of them
      • minimizing variance
      • subject to a constraint on cost of collecting all labels
  • Insights:
    • Minimizing variance is like minimizing MSE
    • If you know the covariance matrix Σ of the X’s you can find the optimal allocation of examples and weights λ
      • Not in closed form – with a fancy algorithm (SOCP)
    • It’s practical to estimate Σ with the labeled examples
      1. estimate Σ
      2. solve the allocation problem
      3. sample the data

​

​

75 of 80

MultiPPI

win-rate: Claude-2.1 and GPT-4-1106-Preview

​

(X1, X2, X3) = (human label, Gemini 2.5 Pro label, Gemini 2.5 Flash label)

expensive, cheaper, even cheaper

76 of 80

MultiPPI

whether a given math proof solution contains a process error

​

varying amounts of test-time compute for Gemini 2.5 Pro

77 of 80

ICLR 2027

  • many kinds of covariates / autorater labels
  • uniform costs
  • many ratings are already provided, some are not

matrix completion is the rectifier!

78 of 80

ICLR 2027

79 of 80

Recap: PPI - Unbiased AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

Arguments for:

  • much more data can be collected faster
  • my project is late / over budget
  • human labels are noisy
  • LLM-as-judge biases seem to be minor

​

​

Argument against: ML/GenAI systems are interconnected

  • We generate data for ML with GenAI (data augmentation)
  • We evaluate ML systems with GenAI
  • We pre-train ML systems on ML-filtered text
  • We pre-train ML systems on GenAI-produced text
  • Long-term, will subtle biases have subtle effects? or large effects?

​

​

​

​

​

80 of 80

Recap: PPI - Unbiased AI Judges

  • One solution: build an AI system to perform evaluation!
  • … but is this a good idea?

​

Arguments for:

  • much more data can be collected faster
  • my project is late / over budget
  • human labels are noisy
  • LLM-as-judge biases seem to be minor

​

​

Remember:

  • A small amount of human-labeled data can be used to correct for biases in a judge/autorater
  • using prediction-powered inference / active inference