How the Human-AI Division of Labor Determines Programming Productivity
Choosing the right AI coding tool matters far less than how you divide work between humans and AI. As large language models close the capability gap, the real differences between tools come down to which stage you place them in and what you feed them—not the tool itself. This article presents a practical collaboration framework across four phases: exploration, modeling, implementation, and verification. It assigns domain abstraction, mechanism design, and trade-off decisions to humans, while handing pattern-driven coding, testing, and initial exploration to AI. Using the information-propagation mechanism of a historical simulator as an end-to-end example, it shows how clear models, written contracts, and tests written up front let AI deliver reliable code, and it closes with a pitfall checklist and five self-check questions to decide what is safe to delegate.
Introduction: A Question More Important Than “Which Tool Should I Use?”
You see the same question in communities all the time: when you’re coding, which AI coding tool should you actually use? The answers vary wildly, but they all rest on a hidden assumption—that the tool determines the quality of what you produce.
That assumption doesn’t hold. Over the past year or two, the code-generation ability of mainstream large language models has kept improving fast. AI coding tools can already handle a large share of routine work: completing functions, writing scripts, generating pages, even refactoring modules. Once the baseline capability rises across the board, the payoff from “which one to pick” shrinks. The real differences between tools show up more in which stage you put them in and what kind of input you hand them.
The failure modes deserve even more attention. Plenty of AI-assisted projects move fast in the prototype stage, then get harder and harder to change as features pile up—one change ripples through the whole system, until it becomes something nobody can maintain. The cause usually isn’t a weak model. It’s that the domain abstraction that should have been the human’s job got skipped: people take a vague idea and ask AI to generate features directly, with no clear definition of the business concepts, data structures, or how rules flow. The result is layer after layer of stacking. Each local piece of code might look nice, but the whole system keeps accumulating technical debt.
So the question should shift from “which tool” to three more fundamental ones:
- Which work should humans lead—domain modeling, mechanism design, and trade-off decisions?
- Which work can be handed to AI with confidence—pattern-clear coding, test writing, and initial exploration of unfamiliar territory?
- What should pass between humans and AI so that collaboration is genuinely effective, not just fast?
This article offers a practical collaboration framework built around those three questions, and demonstrates it end to end with the “information propagation” mechanism in a historical simulator.
1. The Core Principle: Humans Are the Architects, AI Is the Construction Crew
You can break software development into four phases and redefine the human-AI split at each one.
| Phase | Human’s role | AI’s role | Key deliverable | Definition of done |
|---|---|---|---|---|
| Exploration | Define the problem, weigh trade-offs | Brainstorm, propose candidates | Problem list and option comparison | At least two distinct approaches, with clear pros and cons |
| Modeling | Define concepts and data structures | Map relationships, ask clarifying questions | Domain model, state machine, rule tables | Every concept has one clear definition and can answer “who owns it” |
| Implementation | Split modules, agree on interfaces | Generate and refactor code against the contract | Code and unit tests | Interfaces fully implemented, tests passing |
| Verification | Accept, handle edge cases and experience | Generate edge cases, analyze failure logs | Test report and fix list | Reproduction and regression pass rates meet the bar |
The core principle: humans decide what to build and how to express it, AI decides how to write it and how to write it fast. The four phases link together, and if an earlier phase is missing, there’s no point discussing the quality of the next one. The modeling phase is especially important here, because the model itself carries the responsibility of communication. A good domain model can be described completely in a few sentences, which is exactly what makes it easy to hand to AI. A vague, muddled model can’t be explained clearly, AI can’t understand it, and the code that comes out is unpredictable by nature.
2. Exploration: AI Provides Breadth, Humans Make the Trade-offs
In the exploration phase, requirements are usually vague: “I want to build a historical simulator, focused on how information spreads.” If you let AI start writing code right away, it can usually only produce a feature-list outline—character systems, a map, event triggers, random numbers. These generic skeletons fit anything, yet they skip exactly the hardest and most personal question: how a message gets distorted and passed between people’s minds and social networks, and finally settles into “history.”
This is the phase where AI works best as a divergence tool:
- Enumerating classic mechanisms from the field—how rumors spread, how reputation forms, how positions polarize;
- Comparing a few ways to abstract the problem—treating “information” as an object that can be altered, versus as the result of a computation;
- Poking holes in the design document—how memory is inherited after a character dies, how values across generations converge;
- Lowering the barrier from idea to a runnable version for visual experiments involving portraits or rendering.
But the trade-offs have to be made by humans. The appeal of a historical simulator comes from a single misremembered sentence, a forged accusation, a historian’s private agenda. Whether you aim for a realistic macro-scale simulation or a drama-driven story generator determines the direction of every data structure and rule that follows. Outsource that goal, and the model will push forward along the most common, safest pattern—and you get exactly the kind of system that “runs, but isn’t fun.”
A simple test tells you whether exploration is done: can you explain the world’s core mechanism and what makes it unique in three or four sentences? If you can’t, you’re not ready for the next phase.
3. Modeling: You Have to Do the Abstraction Yourself
3.1 Why AI Can’t Cover the Abstraction Lesson for You
Models learn from vast public code and text, and they’re good at reproducing common patterns—deduplicating a list, drawing a donut chart, splitting a function into smaller units. But domain abstraction solves a different layer of the problem: in your world, what the concepts are, how they act on each other, and how conflicts get resolved.
- Your domain knowledge is what the model doesn’t have. How two people negotiating a marriage get swayed by both families’ attitudes, whether the son or the mother cares more about family standing—there’s almost no clear answer to be found in public corpora.
- Models tend to comply rather than challenge. Even if a model happens to think of a relevant concept, it usually won’t stop to ask “does this fit what you intended.” It just keeps stacking structure on top of the existing context.
- Locally reasonable doesn’t mean globally consistent. Each snippet can look fine on its own, but together they may have conflicting semantics, states with nowhere to live, and overlapping responsibilities. Models default to producing code that “looks complete” and won’t maintain global consistency for you.
- Introducing abstraction early avoids large-scale rework. Iterating frequently in a prototype is normal, but the cost of each change depends heavily on how the information is expressed in the first place.
3.2 The Core Abstraction: Information Is a Deformable, Traceable Narrative
Working back from the original design idea, information propagation has to answer three questions: what is information expressed as? How does it flow? How does it settle? A reliable abstraction treats information as a narrative—an object that a reteller can modify according to their own stance, while leaving a complete record of how it traveled. At minimum, it contains:
- The original facts: what actually happened, held by the system;
- Tellings and versions: who told whom, when, in what setting, and what they changed while telling;
- The source chain: through whom this version passed, and how much each link discounted it;
- The receiver’s understanding: who believes it, how strongly, whether they doubt it, and how they ultimately judge it;
- Records and legacy: who wrote it down, into what, and how later generations read it.
Once information and history become traceable objects rather than boolean flags scattered everywhere, the mechanisms that come later—kinship, suspicion and verification, marriage negotiations—can all be added gradually as operations on that object, without repeatedly rebuilding the foundation. That is the real value of good abstraction: it turns the uncertainty of “what we’ll need to build later” into the manageable problem of “which operations to add to the objects we already have.”
3.3 Model Society as a Directed Weighted Graph
“Society is a big graph”—most people can think of that much. The real difficulty is defining the semantics of each element: what a relationship the edge represents, whether direction matters, what the weight means, and how its strength changes over time. Only when those are pinned down will the implementation stay on track.
- Relationships are typed. Kin, master and apprentice, colleagues, rivals, trade, romance—each type maps to a different information-discount coefficient. The same slander carries a very different impact depending on whether it comes from an enemy or from a father.
- Relationships are bidirectional but usually asymmetric. A may answer to B while B barely acknowledges A. Whether you store a single edge and query it both ways, or store a separate directed edge in each direction, leads to different traversal experiences—decide this up front.
- Relationships are dynamic. A marriage changes the edges between two families, a public falling-out erases a friendship, a new event creates new edges.
- Relationship strength accumulates through repeated interaction. Trust rises over many encounters, and a single deception can bring it down sharply.
An adjacency list is a good fit here because the graph is sparse and edges must be added or removed dynamically as entities come and go. Keep the edge structure extensible rather than hardcoding “weight,” “type,” and “trustworthy” as separate fields.
from __future__ import annotationsfrom dataclasses import dataclass, fieldfrom typing import Any# ============ 1. Core entities: naming precedes implementation ============@dataclass(frozen=True)class Person:pid: strname: strtraits: dict[str, float] = field(default_factory=dict) # e.g. {'suspicion': 0.3}stance: dict[str, float] = field(default_factory=dict) # event/person -> stance [-1, 1]@dataclassclass Relation:kind: str # kin / master / colleague / rival / friend / spouseweight: float = 0.0 # intimacy, trust, etc. [0, 1]modified_at: int = 0extra: dict[str, Any] = field(default_factory=dict)@dataclassclass Account:"""A single telling: the deformable carrier of information"""event_id: strtext: strby: str # narratorto: str # receiverfidelity: float = 1.0 # fidelity: 1 means verbatim retellinglineage: tuple[str, ...] = () # source chain@dataclassclass Record:"""A written-down version: historical record"""event_id: strauthor: strtext: straudience: str = "public" # official history / private notes / folk legend# ============ 2. Social network: directed weighted graph ============class Society:def __init__(self) -> None:self.persons: dict[str, Person] = {}self.adj: dict[str, dict[str, Relation]] = {}def add(self, person: Person) -> None:self.persons[person.pid] = personself.adj.setdefault(person.pid, {})def bind(self, src: str, dst: str, relation: Relation) -> None:self.adj[src][dst] = relation # directed: relations can be asymmetricdef rel(self, src: str, dst: str) -> Relation:return self.adj[src].get(dst, Relation(kind="stranger", weight=0.0))
Once the graph is in place, the observer mechanism should be among the first things you write, not something you patch in later. Every relationship change—telling, forming a grudge, marrying, dying—publishes an event, and subscribers update their caches or indexes as needed. For the one-off answers that don’t exist in public corpora, and the details you can’t confirm with stakeholders, stand them up first as rules marked with TODOs and manage them centrally. That’s completely fine in a prototype, but before launch they must be confirmed or decided by you.
4. Information Flow: Every Rule Needs a Definite Owner
Structure determines what’s possible; rules determine how the world actually runs. You can’t finish all the abstraction in one pass, so a more practical move is to first decide “who owns this rule,” even if the implementation stays simple for now.
- Fidelity is shaped together by the narrator’s stance, personality, and setting. An enemy recounting an opponent’s misdeeds leans systematically negative; a public setting calls for decorum and distorts less; a private tavern invites embellishment. The same event, retold by people with different personalities, should come out with different wording.
- The receiver’s judgment depends on the weight of the relationship between the two parties. Words between father and son, or master and apprentice, are readily accepted; a rival’s claims are easily laughed off.
- Once doubt appears, there has to be a path toward verification. Doubt comes from hearing something that clashes with what you’ve seen, from a third party’s accusation, or from an odd reaction. Verification drives dialogue, investigation, and confrontation. For a narrative, this is where the story truly begins: a system that only propagates blindly will never generate any tension.
- Different recorders filter versions by their own stance. Eyewitness accounts, the verdict of an official history, folk embellishments—layer them up, and the “history” later generations read often ends up far from the truth. The depth of a historical simulator comes from exactly this layering.
These rules can collapse into three interfaces—speak, receive, and record—each spawning its own clear rules. Once the interfaces are fixed, you reach the part AI is best at.
def fidelity_of(soc: Society, narrator: Person, topic: str, venue: str) -> float:# TODO(to confirm): coefficient for how venue affects distortion; needs calibration against historical materialbias = -narrator.traits.get("bias", 0.0) * narrator.stance.get(topic, 0.0)return max(0.0, min(1.0, 1.0 - 0.3 * abs(bias)))def receive(soc: Society, src: str, dst: str, account: Account) -> float:"""How much the receiver trusts this version; returns [0, 1]"""rel = soc.rel(dst, src)fidelity = account.fidelitystance = soc.persons[dst].stance.get(account.event_id, 0.0)credence = 0.5 * rel.weight + 0.5 * fidelity - 0.2 * abs(stance)return max(0.0, min(1.0, credence))def should_investigate(p: Person, doubt: float) -> bool:# personality-level rule (defined by humans); threshold is a tunable parameter (filled in by the implementation layer)return doubt > p.traits.get("suspicion", 0.5) * 0.6
5. Three Judgments an LLM Can’t Make for You: Courtship, Marriage, and Record-Keeping
There’s a class of questions AI almost certainly can’t answer for you: who gets the final say on someone’s marriage, who can veto it, and what the different opinions add up to? The answers differ completely across eras and regions—there’s no version of “your world” in public corpora. The judgments involved span at least three levels:
- Who holds decision power, the person or the family. Imperial eras leaned heavily on parental authority; modern society leans toward personal choice. The more powerful the family, the more binding outside opinions become.
- Whose opinions count and how to weigh them. Parents, siblings, close friends, and matchmakers each carry different influence, and a person’s voice depends on their social role.
- How different stances combine into one outcome. When most of the family objects, does the person comply, hold firm, or trigger a falling-out? If this is a game mechanic, the parameters should be adjustable by the player rather than hardcoding some average into the code.
These rules look scattered, but a handful of parameters plus a weight table can express them all, with no need to write a branch for every character:
DECISION_WEIGHTS = {# relation type: weight of that opinion in the person's own decision"parent": 0.35, "sibling": 0.15, "friend": 0.10,"self": 0.30, "other": 0.10,}OPINION_WEIGHTS = {# relation type: that member's say / voice"kin": 1.0, "friend": 0.4, "other": 0.1,}def decide_marriage(soc: Society, person_id: str, candidate_id: str) -> float:"""Aggregate relatives' and friends' evaluations of the candidate; return an overallleaning in [-1, 1]. Closer to 1 means more supportive, closer to -1 means more opposed."""me = soc.persons[person_id]candidate = soc.persons[candidate_id]total = DECISION_WEIGHTS["self"] * me.stance.get(candidate_id, 0.0)for kin_id, rel in soc.adj[person_id].items():w_self = DECISION_WEIGHTS.get(rel.kind, DECISION_WEIGHTS["other"])w_voice = OPINION_WEIGHTS.get(rel.kind, OPINION_WEIGHTS["other"])total += w_self * w_voice * soc.persons[kin_id].stance.get(candidate_id, 0.0)return max(-1.0, min(1.0, total))
Its elegance is that it splits “family resistance” into three independent parts:
- The person’s own attitude (the self weight times their own stance);
- Each relative’s stance (the stance dictionary);
- Each relative’s weight and voice (the DECISION_WEIGHTS and OPINION_WEIGHTS tables).
Later, adjusting a fact like “the mother is more conservative than the elder brother” won’t require touching the function itself. At that point, the task you hand to AI becomes very concrete: write the functions that update stance, keep values within range with sensible defaults, and fill in the unit tests. With clear semantics and constraints in place, the model can usually produce a clean, well-commented implementation that handles the edge cases.
6. The Collaboration Workflow: From a Wish to a Runnable System
Once the abstraction is settled, you can move through “spec → skeleton → implementation → verification,” giving AI only what it’s good at in each step.
6.1 Spec: Contract First, Then Code
Interfaces, data structures, and state transitions written out as a text contract are themselves the highest-quality input you can give AI.
[Role] You are a senior engineer responsible for implementing a specified module per the contract.[Module] Gossip propagation of the simulator (gossip.py)[Contract]- Person must contain at least the pid, traits, and stance fields; stance keys are events or topics;- New rules must not modify existing entity structures;- Relation must carry kind and weight, and support directed updates.[Input] A summary of a historical simulator's design document, plus the domain model below.[Constraints] Output only this module's code and tests, do not modify other modules; all thresholds are centrally configured.[Acceptance] Provide reproducible test cases covering trust calculation and suspicion triggering.
6.2 Skeleton: Write the Tests First, Then Let AI Fill In the Blanks
For verification, the most important investment is writing a batch of representative assertions up front, covering boundary and combined cases—for example, the gap in a receiver’s trust when the same message comes from an enemy versus a father, or the fact that a clearly biased telling should score much lower on fidelity than a neutral one. The tests define what “correct” means first, and then AI has a clear target to work against. You can also write the skeleton yourself as empty shells with TODOs and hand AI one module at a time to implement—that’s more reliable than asking a model to generate the whole system in one go.
6.3 Implementation: Deliver in Small Steps, One Thing at a Time
Once a module is implemented, verify it immediately, and only then move to the next. When there are many modules, ask AI to implement just one at a time, each with its matching tests—don’t count on it producing every feature in a single shot. And review each piece of AI output against the standard “does this hold together within the whole,” rather than inspecting it line by line.
6.4 Verification: Treat “AI-Written” Code as Code Under Audit
The main risk in a prototype is that a model can “confidently write the wrong thing.” A few practices help in the verification phase:
- Record exactly which behavior each test case covers, and check them one by one against the design document;
- Log key state changes in the logs or event stream, so you can trace “why the result ended up this way”;
- Run static analysis and manual review on model-generated code, and avoid merging anything unreviewed;
- Gradually add checks for performance, concurrency, and resource usage, so the simulator runs long and stays stable.
When the system moves into integration and deployment, you can lean on general cloud capabilities: a container platform to host the simulation services, object storage for the scenario data, a logging service to capture run traces, and monitoring and alerting to flag anomalies as they happen. On Baidu AI Cloud, these general-purpose infrastructure capabilities can help a team keep its energy focused on domain modeling and mechanism design—the parts that genuinely need a human.
7. Pitfall Checklist and Self-Check
Condensing the above into a few executable rules:
- Free-form AI works for exploration and transformation; anything involving domain abstraction, you must do yourself.
- Don’t let AI generate an entire system in one shot without a contract—small steps and incremental verification are always more stable.
- Parameterize and make things configurable; that’s the key to letting rules evolve without rewriting code.
- Stay skeptical of code that “looks right.” The acceptance bar is “it holds within the whole system,” not “it holds within a single function.”
- Watch out for the “the data looks great” trap: a cleverly chosen random seed can hide flaws in the model itself.
Before each time you let AI take over, run through five questions:
- Can I explain this piece’s core mechanism clearly in a paragraph?
- Is this piece’s domain knowledge something you can look up in public corpora, or something only I know?
- Can I design test cases that verify this piece?
- If AI gets it wrong, can I tell at a glance which rule it broke?
- Which existing structures will this change touch, and which extension points need to be reserved in advance?
If you can answer all five, hand it to AI with confidence. If you can’t answer one, then this is a step you should still do yourself.
Conclusion
“Which tool should I use” is a phase-bound question, and better models will keep rewriting the answer. The more durable question is how to divide labor with a collaborator whose capabilities keep growing. When abstraction, contracts, and verification stay firmly in human hands, AI’s value is finally unleashed: you decide how the world runs, and it builds the world for you.
