I needed a JavaScript function that extracts label-name associations from text. Instead of writing one function, I distilled a swarm.
A note on why this was manual. The obvious approach is to call an API and let it do the extraction. That costs money per call, and the budget wasn’t there. So I did it by hand. Manual training, manual refinement, manual loops. Slower, but it cost nothing but my time.
One clarification on the word “swarm.” DeepSeek is itself a swarm — a model composed of many learned parts. I trained ten of its instances: nine producers and one synthesizer, each in a separate conversation, each unaware of the others. What came out the other side was ten JavaScript functions.
Here’s the procedure.

Step one: build diversity
I created nine separate document sets. Each set was different enough that a function trained on one would fail differently from a function trained on another.
Diversity wasn’t a side effect. It was the point. Nine extractors with nine biases produce nine different kinds of mistakes.
Step two: generate nine extractors
I opened nine separate conversations with DeepSeek. Into each, I fed one document set and asked for a JavaScript function that extracts candidate label-name associations from it.
Nine conversations. Nine functions. Each one independent, each trained on its own slice of the problem, none of them aware of the others.
Step three: check for overfitting
Before refining anything, I asked DeepSeek where each function overfits.
A function trained on one document set will learn that set’s quirks, not the general pattern. It’ll look accurate on the set it was trained on, then fail on anything it hasn’t seen.
So I asked DeepSeek to identify the overfits and remove them first. Only then did refinement make sense.
Without this step, the nine functions would have been usable only on their own training data. The swarm would have been nine specialists with no shared ability.
Step four: refine by feedback
Then I ran the loop.
I sent each function’s output — its candidates — back to DeepSeek and asked it to find the problems. Then I asked it to refine the function. Then I ran it again, and fed the new output back.
The checking was mostly DeepSeek’s. It found the problems in its own output. My role was to glance at the results and decide whether to run another round.
I never prepared a golden set of correct answers. The test was whether the candidates looked right — judged mainly by the model, confirmed by me.
I repeated this until the candidates looked good enough. Nine functions, each refined the same way, each in its own conversation.
Step five: build the synthesizer
Now I had nine extractors producing candidates. I needed one function to decide.
I opened a tenth conversation. I fed in the outputs of all nine and asked DeepSeek to generate a synthesizer — a function that takes the candidates and produces the final label-name pairs.
I didn’t ask it to vote. I asked it to reason over the candidates and produce a result.
Step six: refine the synthesizer
Same loop, one level up. Same overfitting check first, then refinement.
I sent the synthesizer’s results back to DeepSeek, asked it to identify the problems, and asked it to refine the function. Repeated until the output looked good enough.
Same partial supervision. No golden answers. The judgment was the model’s, the decision to continue was mine.
What I ended up with
Ten JavaScript functions. Nine extractors. One synthesizer.
Everything is learned — no fixed rules anywhere. The ten functions are independent of each other, and at runtime, DeepSeek isn’t called at all. The knowledge is already in them.
And the architecture is mine. I chose the document sets, the count, and the two-layer structure. DeepSeek generated the functions and refined them, but the shape of the system was a human decision.
What I took from it
A swarm isn’t something you find. It’s something you compose.
The value came from the diversity — nine functions that fail differently. If they had all been trained on the same data, the synthesizer would have had nothing to work with.
But diversity alone isn’t enough. Each function had to generalize. The overfitting check came before every refinement, and it’s the reason the swarm could handle documents it had never seen.
And it worked without labels. No ground truth, no test set. The refinement loop ran on the model’s own critique, with a human deciding when to stop.
Diversity first. Then generalization. Then synthesis.