The longest of eight words (divide and conquer) · SmolLM2 135M
Statement
The task is to find the word with the most characters out of eight. The structure is the same as P51. Four look at two each, two merge, and one finishes up.
Here is how one real case climbs through the seven positions.
| Position | What it receives | What it prints |
|---|---|---|
| Leaf 1 | coax, bridge | bridge |
| Leaf 2 | pen, waterfall | waterfall |
| Leaf 3 | sky, orange | orange |
| Leaf 4 | lamp, window | window |
| Merge 1 | bridge, waterfall | waterfall |
| Merge 2 | orange, window | same length, either one |
| Top | waterfall, the result of Merge 2 | waterfall |
Positions like Merge 2, where two words of the same length meet, do come up. In this case the answer at the top is waterfall whichever of them goes up.
One more blind spot is laid on top here. The model cannot see characters. It only sees tokens. To measure a length you have to make it write the characters out one at a time, but that makes the output long, and the position above then receives a messy input. You have to keep in mind that what the level below puts out is the input the level above receives.
Input
The input arrives as 8 lines.
The whole input is between 38 and 54 characters long.
Output
On the first line print the longer of the two words.
The output is between 9 and 16 characters long.
Do not add any other characters.
Not a single character may differ from the expected value.
Requirements
- The input is two lines, one word per line.
- The output is the longer of the two words.
- This is chat mode. The prompt is wrapped in a chat template, so the model becomes an assistant. You can write control tokens yourself to build a conversation of several turns.
- One case is split into eight pieces. Four agents take two pieces each, two merge those results, and one finishes up. The model runs seven times.
- The same prompt is used at every position. At a leaf it receives the two original pieces, and at a merging position it receives the two results from below. It has to work in both.
- Grading looks only at the output of the single agent at the top. If something goes wrong in the middle, it spreads straight upward.
- The output must match the expected value down to the last character. Only leading and trailing whitespace is ignored.
- This problem is solved with SmolLM2 135M. It is a far smaller model than Qwen3 0.6B, so the same prompt does not simply carry over.
- There are 16 cases, and 5 of them show the input together with the expected output. The rest show the input only.
- Model output is accepted up to 120 tokens.
- Passing 14 or more of the 16 cases solves this.
Examples
5 public cases. Judging also uses hidden cases. Passing 14 or more of the 16 cases solves this.
coax bridge pen waterfall sky orange lamp window
waterfall
judge token margin prompt stone riverbank apple desk
riverbank
model local candle tiger mountainous paper cloud table
mountainous
green north pencil elephantine water music chair road
elephantine
street blue notebook cup incomprehensible map door fan
incomprehensible
Notes
Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.
SmolLM2 135M is a fraction of the size of Qwen3 0.6B. It lets instructions slide far more often. You have to say the same thing more briefly and more clearly for it to listen.