Menu

Why does a small local LLM repeat itself when you ask it for 100 rows of JSON?
πŸ“°

Why does a small local LLM repeat itself when you ask it for 100 rows of JSON?

DEV Community: machinelearningΒ·Hanako H.Β·1 day ago
#HIe2vbRq
#devtomachinelearning#education#devto#dev#rows
Reading 0:00
15s threshold

Asking a language model for synthetic training data usually means one prompt: "Generate N rows as a JSON array", a schema, a few example rows. With a 3B model running on a laptop, that works at 20 rows and starts to fall apart at 40, in a very specific way: the model starts copying its own earlier rows and never stops. The numbers below come from running that kind of prompt many times on Qwen2.5-3B-Instruct (4-bit, through mlx-lm ) on an 8 GB Apple M1, measuring when the loop starts, why it is so hard for the model to leave it, and which fixes hold up.

The prompt and the setup

The prompt is the one the dataset generator in the osFoundry desktop app builds ( buildPrompt in its PromptEditor.tsx ), for a text-classification dataset of online-shop messages with three allowed labels and three example rows:

SYSTEM = " You are a data generation assistant. Output only valid JSON arrays.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.