포스트

ollacode System Prompt Optimization: Korean → English Benchmark Results

Switching ollacode's system prompt from Korean to English and measuring real performance gains with ollama-bench. About 60% lower recorded prefill duration and 55% fewer first-round input tokens in this local comparison.

ollacode System Prompt Optimization: Korean → English Benchmark Results

Correction — September 13, 2026: The original TTFT columns use Ollama’s prompt_eval_duration; they are now labeled prefill duration. The reported memory values are samples, not continuous peaks. The table is retained as a historical comparison, with causal claims narrowed to what it measures.

Background

In the previous post, I tried reducing ollacode’s prompt token usage by rewriting its system prompt in English. Token usage depends on the tokenizer and the exact wording. The English rewrite used fewer first-round input tokens in this comparison; that does not establish a universal advantage for English prompts.

But theory alone isn’t enough. I built ollama-bench and measured the difference with real data.

Experiment Setup

ParameterValue
Modelqwen3-coder:30b
HardwareMac Mini (Apple Silicon)
Benchmark modecontext-growth (5 rounds)
Seed42
Temperature0.0
WorkloadSame 20-prompt coding sequence

What we’re comparing:

  • Before (Korean): Korean system prompt (~2000 chars, 732 input tokens)
  • After (English): English system prompt (~1200 chars, 331 input tokens)

Results

Per-Round Data

Korean System Prompt

RoundIn TokOut TokGen t/sPrefill t/sPrefill(ms)Total(ms)Mem(MB)
173229636.4317.42,30725,10319,335
21,05759134.62,181.748417,80619,333
31,68386532.82,218.275927,43919,338
42,5781,15031.23,012.685638,08319,345
53,7541,36528.92,831.71,32648,87019,343

English System Prompt

RoundIn TokOut TokGen t/sPrefill t/sPrefill(ms)Total(ms)Mem(MB)
133123238.2339.69757,21119,356
259152736.91,934.230614,74819,357
31,15292335.13,266.735326,93719,358
42,10462432.66,098.834519,67219,356
52,7531,07127.38,401.232840,30419,289

Summary Comparison

MetricKoreanEnglishChange
Avg Gen Speed32.8 t/s34.0 t/s+3.8% ✅
Avg Prefill Duration1,146 ms461 ms-59.8% ✅
Avg Prefill Speed2,112 t/s4,008 t/s+89.8% ✅
Round 1 Input Tokens732331-54.8% ✅
Max Sampled RSS19,345 MB19,358 MB+0.1% (negligible)

Analysis

1. 55% Fewer First-Round Input Tokens

The first round reports 732 input tokens for the Korean configuration and 331 for the English configuration, a 54.8% reduction. These are request-level input counts, not a separately measured tokenizer count of the system prompt alone. Later rounds include generated conversation history, which also differs between runs.

graph LR
    A["Korean configuration<br/>732 first-round input tokens"] -->|"-55%"| B["English configuration<br/>331 first-round input tokens"]

    style A fill:#e74c3c,stroke:#c0392b,color:#fff
    style B fill:#27ae60,stroke:#1e8449,color:#fff

The rewrite changed both language and wording/length. Tokenization can contribute to the difference, but the table does not isolate language as the only cause or validate identical instruction-following quality.

2. Recorded Prefill Duration Fell by About 60%

Average reported prompt evaluation duration fell from 1,146 ms to 461 ms. The benchmark stored this in ttft_ms, but it did not stream responses or measure the first token’s arrival. It therefore supports a reduction in this server-side phase, not a measured 60% reduction in client TTFT. Metric definition and limitation

3. Prefill Speed Doubled (+90%)

Prefill speed jumped from 2,112 → 4,008 t/s — nearly 2× faster.

Rounds 4–5 report 6,000–8,400 t/s in the English configuration. The table alone does not identify the cause: processed-token counts, prefix reuse, warm-up, and differing conversation histories need to be controlled before attributing this to GPU efficiency or prompt language.

4. Generation Speed — Modest Improvement

Gen speed improved from 32.8 → 34.0 t/s (+3.8%).

This is a small observed difference in a five-round comparison. Context length, differing outputs, and run variability can affect it. No cache-hit counters or repeated-run uncertainty estimates were recorded here, so a cache-efficiency explanation is unverified.

5. Memory — No Change

Sampled RSS stayed near the original table’s 19.3GB scale. Fixed KV preallocation and the large weight footprint can hide differences in used token slots; this observation does not show that token count has no effect on KV requirements.

Key Takeaway

flowchart TD
    A["Observed Korean vs English comparison"] --> B["First-round input tokens 55% lower"]
    A --> C["Recorded prefill duration 60% lower"]
    A --> D["Recorded prefill throughput 90% higher"]
    A --> E["Recorded generation speed about 4% higher"]
    A --> F["Sampled RSS nearly unchanged"]

    style A fill:#3498db,stroke:#2980b9,color:#fff
    style C fill:#27ae60,stroke:#1e8449,color:#fff
    style D fill:#27ae60,stroke:#1e8449,color:#fff

The English rewrite reduced input tokens and recorded prefill duration in this configuration. Compare token count, instruction-following quality, output language, and end-to-end latency for the actual model and workload before adopting the same change elsewhere.

Tools Used

This benchmark was run with ollama-bench:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Korean prompt benchmark
ollama-bench --model qwen3-coder:30b --rounds 5 \
  --system-prompt korean_prompt.txt \
  --system-prompt-label korean \
  --output bench_korean.json

# English prompt benchmark
ollama-bench --model qwen3-coder:30b --rounds 5 \
  --system-prompt english_prompt.txt \
  --system-prompt-label english \
  --output bench_english.json

# Compare
ollama-bench --compare bench_korean.json bench_english.json

ollacode optimization results. Data-driven decisions are the foundation of meaningful optimization.

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.