bugger.
All challenges/Pythonhardllm-residual-sinkhorn-v1
THE INVESTIGATION

Mix residual streams with Sinkhorn normalization

Project mixing logits into an approximately doubly stochastic residual matrix.

LLM ArchitectureFrontier variants

What’s going wrong

Original LLM Architecture lab. Implement the missing behavior in solve(data) and keep the supplied JSON interface. Use Python’s standard library.

Given an S×S logits matrix, streams (S feature vectors) and positive iterations, exponentiate after subtracting the global maximum. Logit range is at most 100. Each iteration normalizes every row by its sum and then every column by its sum. Return mixing and output = mixing×streams. Run exactly the requested number of iterations.

Small, well-formed JSON inputs and standard-library Python arithmetic. Keep full precision during computation. The supplied output wrapper rounds results to six decimal places.

Expected behavior

Project mixing logits into an approximately doubly stochastic residual matrix.

Reproduction

01 Nonsymmetric logits require both axis normalizations
{"logits":[[3,1],[0,2]],"streams":[[1,2],[5,6]],"iterations":6}
{"mixing":[[0.880797,0.119203],[0.119203,0.880797]],"output":[[1.476812,2.476812],[4.523188,5.523188]]}
02 Single stream is identity
{"logits":[[1]],"streams":[[2,3]],"iterations":4}
{"mixing":[[1]],"output":[[2,3]]}
03 Uniform logits average all streams
{"logits":[[1,1],[1,1]],"streams":[[2],[6]],"iterations":2}
{"mixing":[[0.5,0.5],[0.5,0.5]],"output":[[4],[4]]}

Before you begin

  • Python functions, lists and dictionaries

Need a nudge?

Reveal one investigation hint at a time. Try each clue before opening the next.

    The bug is intentional. Run the starter code to see it fail, then work toward a fix. Difficulty is provisional.
    Read-only preview
    Ready when you are
    Every fix starts with a failing test.

    Read the report, then sign in to start your investigation.