Teach a tiny model to rearrange a phrase

Write an original phrase. Its words become the dictionary, and a tiny language model memorizes it. Then write a target phrase that rearranges those same words. LoRA keeps the memorized model frozen and trains a small adapter ΔW = B·A that makes it say the target instead.

1 · Your phrases

Try an example:

Dictionary:

2 · Train the adapter

Loss: –
Trainable numbers: –
rank(ΔW): –
rank of the change needed: –

3 · What the model writes

Each model gets the same starting words (the beginning of the target phrase) and keeps adding its most likely next word.

Starting words:
Original model:
Adapted model:
Target phrase:

Next-word probabilities

Each row is a context. Bars follow dictionary order. Orange marks words the target teaches. Only contexts that appear in your phrases are shown.

4 · What the adapter is made of

Each column of B times its row of A is one simple “layer” of change; the layers add up to ΔW. Edit B and A by hand if you like (dashed cells).

×

Rows are contexts, columns are next words, both in dictionary order. Orange adds to a score, blue subtracts. “needed” is the change that would exactly produce the target.