How to Choose an LLM for Writing and Apply Prompt Engineering

    This article reframes large language model selection for writing tasks from a subjective "best model" question into a measurable engineering problem. It breaks writing ability into four evaluation dimensions—style controllability, long-context stability, multilingual and multi-genre coverage, and factual consistency versus cost—and presents a minimal offline evaluation framework with metrics such as style adherence, constraint retention, and drift across rounds. It also introduces a four-layer prompt structure, common engineering pitfalls, and a layered routing architecture for production. Readers will learn how to build a repeatable evaluation set and prompt strategy so that model selection becomes a continuously optimizable engineering capability rather than a one-time judgment.

    1. Reframing the Problem: From “Best Writing Model” to “Measurable Writing Ability”

    In an engineering context, “which model writes best” is not a question that can be answered directly. Writing is not a single capability but a stack of separable dimensions: how controllable the style is, how consistent the output stays across long contexts, how well the model transfers across languages and genres, how reliable it is on facts, and the cost and latency per unit of output. Once these dimensions are separated, selection shifts from “listening to word of mouth” to “running experiments.”

    The original text groups models into three categories—general-purpose, specialized, and lightweight—and this classification still holds in engineering, though it needs measurable criteria. General-purpose models offer broad coverage and a large response space for prompts. Specialized models have clear advantages in a specific language or writing style, but tend to degrade when transferred across domains. Lightweight models provide stability, low latency, and low error rates, making them suitable for high-concurrency production pipelines.

    2. Four Key Evaluation Dimensions

    2.1 Style Controllability

    Style controllability is the adjustable range of tone, sentence structure, and narrative perspective that a model can produce under the same prompt. To evaluate it, fix the semantics and change only the style instruction, then observe whether the output distribution shifts monotonically with the instruction. If strengthening the instruction barely changes the output, the model’s style response has been flattened by over-alignment. If a slightly stronger instruction breaks the output entirely, the controllable range is too narrow.

    2.2 Long-Context Stability

    In long conversations or multi-round rewriting, models gradually lose earlier constraints, producing conflicting settings, drifting character voices, and repeated passages. Engineering should focus on “effective context length” rather than the nominal window size—that is, the number of rounds after which the model still follows the initial format and constraints.

    2.3 Multilingual and Multi-Genre Coverage

    Some models perform strongly in a single language but drop noticeably when switching to another language or crossing genres. Evaluation should build a two-dimensional matrix of the same genre across languages and the same language across genres, avoiding inferences about overall ability from a single-language impression.

    2.4 Factual Consistency and Cost

    The risk in generative writing lies not in prose quality but in plausible-sounding factual errors. You need to distinguish genres that allow fiction from those that require accuracy; the latter must incorporate retrieval and verification. On the cost side, focus on token consumption per unit of text, latency distribution under concurrency, and the extra overhead of retries on failure.

    3. A Practical Evaluation Plan

    Build a small offline evaluation set. It does not need to be large—coverage matters more than quantity:

    1. # Minimal framework for writing ability evaluation
    2. cases = [
    3. {"task": "rewrite", "lang": "zh", "style": "cold", "need_fact": False},
    4. {"task": "continue", "lang": "zh", "style": "satirical", "need_fact": False},
    5. {"task": "summarize", "lang": "en", "style": "neutral", "need_fact": True},
    6. {"task": "long_form", "lang": "en", "style": "epic", "need_fact": False},
    7. ]
    8. def evaluate(model_client, case, rounds=6):
    9. history, scores = [], []
    10. for i in range(rounds):
    11. out = model_client.chat(history + [build_prompt(case, i)])
    12. history.append(out)
    13. scores.append({
    14. "style_follow": style_judge(case["style"], out),
    15. "constraint_kept": constraint_judge(case, out),
    16. "fact_ok": fact_check(out) if case["need_fact"] else True,
    17. })
    18. return {"case": case, "per_round": scores,
    19. "drift": scores[0]["constraint_kept"] - scores[-1]["constraint_kept"]}

    There are three key metrics: style adherence, constraint retention, and the decay of both across rounds (drift). Drift is the most easily overlooked metric, yet it has the greatest impact on the production experience.

    4. A Layered Prompt Structure

    Regardless of which model you choose, stable output comes more from structure than from the model itself. Split the prompt into four layers:

    1. Role and goal layer: state the purpose of the text, the target readers, and the desired reading response.
    2. Hard-constraint layer: fix word count, structure, forbidden expressions, and required information points as a list.
    3. Style layer: describe style through observable features—sentence-length distribution, use of metaphor, narrative person—rather than writing only “make it more sophisticated.”
    4. Example layer: provide one or two positive examples and one negative example; negative examples often converge the output better than positive ones.
    1. [Goal] Technical weekly report for backend engineers
    2. [Hard constraints] No more than 400 words; three paragraphs; include a risk item; no specific version numbers
    3. [Style] Mostly short sentences; no exclamatory sentences; no marketing adjectives
    4. [Negative example] "This product greatly improves efficiency" — forbid this kind of statement

    For long-form output, re-inject the hard constraints in every round instead of relying on the model’s memory. This is the most direct way to suppress context drift.

    5. Common Engineering Pitfalls

    • Style convergence: over-alignment makes outputs from different models highly similar. At that point, move differentiation to prompt structure and post-processing rather than continuing to swap models.
    • Window misjudgment: a large nominal window does not mean constraints are retained for longer; measure multi-round decay empirically.
    • Missing verification: fact-sensitive scenarios must attach retrieval and rule-based checks, decoupling generation from verification.
    • Single-point dependency: the writing pipeline should support multi-model routing, splitting traffic by task type to reduce cost and failure risk.
    • Subjective evaluation: use a fixed evaluation set and automated metrics for regression, avoiding case-by-case judgment by feel.

    6. Selection Recommendations and Architecture

    In practice, a more reasonable approach is not to pick an all-around champion but to build layered routing: template-based text with high concurrency and low risk goes to lightweight models; complex writing that needs cross-language and creative quality goes to models with strong general capability; fact-sensitive content always goes through a “retrieval-augmented + generation + verification” pipeline. If running in the cloud, you can use a container platform to host inference services, object storage to keep evaluation sets and artifacts, a message queue to smooth peaks, and logging and monitoring with alerts to track latency and failure rates. Cloud providers such as Baidu AI Cloud typically offer these general categories of capability, making it easier to standardize the evaluation and release process.

    Final takeaway: differences in writing ability are real, but they show up more in the “controllable range” and “long-range stability” than in vague prose quality. Once you build the evaluation set, the layered prompts, and the routing strategy, selection turns from a one-time judgment into a continuously optimizable engineering capability.