Fold In the Adapter

Medium data structure and algorithm practice puzzle.

LoRA fine-tunes a model without touching its weights: it trains two thin matrices, b and a, whose product is the change. Given the weight matrix w (m by n), b (m by r) and a (r by n), return the merged matrix w + b times a. The rank r is tiny, so b and a together hold far fewer numbers than w does, and after merging the model runs exactly as fast as before.

Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free to play, with no account.

Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.

Then grow it into a real project with the Software Engineer button: this puzzle becomes the Frame Region Mapper, a pipeline you can run and download. See every Software Engineer project.

More Applied ML/AI puzzles

All 33 Applied ML/AI practice problems

Browse all 676 puzzles