# Pre-registration — 2026-11-27-tingyin-dictation-tone-check

```
run_id:        2026-11-27-tingyin-dictation-tone-check
product:       tingyin
tier:          standard
written_at:    2026-11-27T01:45:00Z (draft; fields 7 and 8 filled after the adversary)
```

Working data lives in `~/Repositories/.in-progress/tingyin-study/work/` (WORK below), not in
`runs/<id>/data/`, because `third-party-ops-guard` refuses copies into the skills folder (proposal P-01
of the 2026-11-26 run). Prompts, logs, ledger and record live in this run directory.

## 1. Question

When a native Mandarin recording carries a tone that makes it a different real word, how often do four
speech-recognition models write the word whose tone was actually spoken, and how often the word the
syllables would otherwise be, by model, by context (a word said alone, a word inside a read sentence)
and by how the tone got there (a native speaker really saying the other word, or the pitch of one
syllable replaced)?

## 2. Method

### 2.1 Frame: which words, fixed by rule

- **Pairs.** From `packages/corpus/data/hsk30.csv` in the Tingyin repository (HSK 3.0 word list, MIT,
  with CC-CEDICT readings in column `CEDICT`), take every word of one or two syllables whose first
  CEDICT reading parses as syllables ending in a tone digit 1–4. A **pair** is two such words (A, B)
  with identical toneless syllables that differ in the tone of exactly one syllable, neither tone at
  that syllable being 5 (neutral). Script: `WORK/tools/frame.py`; output `WORK/data/pairs.json` with
  both words, levels, readings and the differing syllable index. Measured on 27 Nov 2026 while
  designing: 3 374 pairs from 9 876 words, of which 505 are two-syllable.
- **Recordings of single words (context W).** Lingua Libre Mandarin recordings on Wikimedia Commons
  (`File:LL-Q9192 (cmn)-<speaker>-<word>.wav`, Category `Lingua Libre pronunciation-cmn`), listed by
  the Commons API with a contact User-Agent and at most one request per second. A recording is in the
  frame when its word is a member of any pair. For each file record: title, speaker, licence from the
  file page's `extmetadata.LicenseShortName`, SHA-256 of the downloaded bytes, duration. Output
  `WORK/data/ll_frame.jsonl`.
- **Sentences (context S).** AISHELL-3 test set (Hugging Face `AISHELL/AISHELL-3`, Apache-2.0,
  `test/content.txt` with per-character surface pinyin and tone). A sentence is in the frame when it
  contains a two-syllable pair word A as consecutive characters and the surface tone label of A's
  differing syllable equals A's CEDICT tone (so tone sandhi has not already changed it). Output
  `WORK/data/a3_frame.jsonl`.

### 2.2 Sample, drawn not picked

- **W-natural:** every Lingua Libre recording in the frame, capped at 3 recordings per (word) and 400
  per speaker, drawn with `random.Random(20261127)`.
- **W-pairs:** the subset of W where the same speaker recorded both A and B of a pair: the natural
  minimal pairs.
- **S:** 240 sentences, drawn with `random.Random(20261127)` from the frame, at most one sentence per
  target word and at most 8 per speaker; if the frame holds fewer than 240 distinct targets, all.

### 2.3 Conditions per item (the one thing that varies is the tone)

Audio is downmixed to mono and resampled to 16 kHz, 16-bit, peak-normalised to −3 dBFS, with 300 ms of
silence before and after (`ffmpeg`). Pitch manipulation uses Praat's overlap-add resynthesis through
`praat-parselmouth` 0.4.7 (`To Manipulation` 10 ms, floor 75 Hz, ceiling 500 Hz; replace pitch tier;
`Get resynthesis (overlap-add)`).

- **natural** — the recording as prepared.
- **identity** — resynthesised with its own measured pitch tier. Measures what the resynthesis alone
  costs.
- **own-template** — the target syllable's pitch replaced by the template of its own tone (A's tone).
  Measures what an artificial but correct contour costs.
- **swap** — the target syllable's pitch replaced by the template of B's tone at the differing syllable.
  Differs from own-template in exactly one thing: the tone of the template.

Templates are in semitones relative to the speaker's median F0 over the item's voiced frames, placed
over the syllable's voiced span on five equally spaced points and interpolated linearly: tone 1
`+4 +4 +4 +4 +4`; tone 2 `−1 −1 +1 +3 +4`; tone 3 `−2 −4 −5 −5 −2` when the syllable is the item's
last, `−2 −4 −5 −5 −5` otherwise (the low half-third tone); tone 4 `+5 +3 0 −3 −5`. Only the target
syllable's pitch points change; every other point is the measured one.

Syllable spans: for W the syllable boundaries come from the FunASR forced aligner `fa-zh` given A's
characters; for single-syllable words the whole voiced span is the syllable. For S the aligner is given
the whole reference sentence. An item whose aligner output does not cover every reference character, or
whose target syllable has fewer than 5 voiced pitch frames, is discarded with the reason recorded.

### 2.4 Recognisers

Each model receives every audio file once (temperature 0 or greedy; output deterministic), language
fixed to Mandarin Chinese, no prompt, no hotwords:

1. Whisper large-v3-turbo, `mlx-community/whisper-large-v3-turbo` via `mlx_whisper` (OpenAI's model,
   the one most apps built on Whisper ship).
2. Whisper small, `mlx-community/whisper-small-mlx` via `mlx_whisper` (the size phone apps embed).
3. Paraformer large, FunASR `paraformer-zh` (`iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch`), Alibaba.
4. SenseVoice Small, FunASR `iic/SenseVoiceSmall`, `language="zh"`, `use_itn=False`, Alibaba.

Model files are recorded by hash of their weights file. Not tested, with the reason: Apple's speech
recogniser (the authorisation request from a command-line binary never returned, so it cannot be run
from a file without a person clicking a permission dialog); Google speech in Chrome (the Web Speech
API started but never received the fake-microphone file in a 45 s probe); Google Cloud Speech (the
project key answers 403 for speech.googleapis.com); Azure Speech (both keys in the Tingyin `.env`
answer 401). Playing audio into a microphone is not used: it would add a room and a microphone that
the file arms do not have.

### 2.5 Scoring, written before any output is seen

Output text: strip `<|…|>` tags, punctuation and spaces; convert traditional to simplified with OpenCC
`t2s`; convert digits to Chinese numerals only if the reference contains none.

- **W:** the output is matched to the target as a whole string. Classes, first match wins:
  `A` (output equals A), `B` (equals B), `A-tone` (the output's pypinyin readings, any heteronym,
  include the target's toneless syllables with A's tones), `B-tone` (same with the swapped tones),
  `other-tone` (same toneless syllables, another tone pattern), `segment-miss` (different syllables or
  length), `empty`.
- **S:** the output is aligned to the reference characters by Levenshtein alignment
  (`WORK/tools/score.py`); the characters aligned to the target word span are scored as in W. A sentence
  whose output differs from the reference in more than 30 per cent of characters outside the target is
  scored `garbled` and kept in the denominator.
- Two derived rates per model × context × condition: **heard** = share scored `B` or `B-tone` (the
  model wrote the tone that was spoken in swap and natural-B items), **kept** = share scored `A` or
  `A-tone` (the model wrote the word the syllables would otherwise be).
- For the natural pairs (W-pairs), an item is the pair: did the model write A for A's recording **and**
  B for B's recording (both right), only one, or neither.

### 2.6 Repetitions, output and provenance

Each model is deterministic, so one transcription per file; a 5 per cent random subset (seed 7) is
transcribed a second time to confirm the output is identical. Rows go to
`WORK/data/transcripts.jsonl` the moment they are produced, one row per (file, model):
`item_id, context, condition, speaker, licence, source_url, source_sha256, file_sha256, target_A,
target_B, model, model_weights_sha256, raw_output, normalised_output, class, measured_at, tool_versions`.
Pitch rows (template points and the measured pitch of the target syllable after manipulation) go to
`WORK/data/pitch.jsonl`. The dataset file is created in an `IN_PROGRESS` state before the first row.

### 2.7 Checks before reading results

- The manipulation is verified by measuring: after resynthesis, the target syllable's F0 (Praat
  autocorrelation) lies within 1.5 semitones of the template at 4 of 5 points in at least 90 per cent of
  swap and own-template files; files that fail are listed and excluded from the swap analysis, with
  their count reported.
- The scorer is falsified first on fixtures: a hand-written set of outputs for 20 items with known
  classes, including a traditional-character output, a homophone with the right tone and a heteronym.

### 2.8 Analysis

Per model × context × condition: counts and rates with 95 per cent bootstrap intervals over items
(10 000 resamples), resampling speakers as clusters for S. Differences called only when the interval on
the difference excludes zero. Breakdown by which tone was swapped to which (12 directions) and by
syllable position, reported as a table when a cell has fewer than 20 items.

## 3. Expectation

- E1. In context W, natural recordings of A are written as A or with A's tones (kept) at least 80 per cent
  of the time by every model, and identity at least 75 per cent.
- E2. In context W, swap items are written with the swapped tone (heard) in at least 40 per cent by at
  least two of the four models, and the Chinese-trained models (Paraformer, SenseVoice) hear more than the
  Whisper models.
- E3. In context S, swap items are heard in at most 25 per cent by every model, that is, the sentence
  keeps the original word far more often than the word alone does.
- E4. On natural pairs (W-pairs), every model gets both members right in at least half the pairs.

## 4. Falsifier

- E1 false if any model's kept rate on W-natural is below 0.80.
- E2 false if fewer than two models have heard ≥ 0.40 on W-swap, or if both Whisper models' heard rates
  exceed both Alibaba models'.
- E3 false if any model's heard rate on S-swap exceeds 0.25, or if S-swap heard is not lower than W-swap
  heard for a model (interval on the difference including zero counts as not lower).
- E4 false if any model gets both members right in fewer than half the W-pairs.

## 5. Abandonment condition

- If for a model the kept rate on own-template items is below 0.60 in W or S, the template arm for that
  model is unusable (the manipulation, not the tone, is what it reacts to); its swap results are not
  reported as tone results. If that holds for all four models, the run records `METHOD_BROKEN` for the
  manipulation arm and reports only the natural arms.
- If the frame yields fewer than 20 W-pairs and fewer than 100 W-natural recordings across at least 3
  speakers, the natural arm is `NOT_MEASURABLE`.
- If fewer than 90 per cent of manipulated files pass the pitch check in 2.7 after one fix to the
  procedure, `METHOD_BROKEN`.

## 6. Estimate

- **What the run needs from Jakub:** nothing. The audio is public (Commons, Hugging Face), the models run
  on this Mac, and no paid interface is called.
- Machine time: about 3 hours of transcription, 1 hour of downloads at one request per second.
- Money: 0 USD.
- Claims expected in the ledger: type M (rates, counts, intervals); type S (licences, model sources, the
  tone-sandhi and half-third-tone descriptions the templates rest on); type D none (Search Console
  numbers only in the record, not in the article).

## 7. Adversary dispositions

32 objections (ADVERSARY.md, child A1b on deepseek-flash): 28 changed the method (O-23 and O-25 through
the changes for O-15 and O-7), 4 accepted as limitations (O-17, O-24, O-26, O-30), and one part of O-24
rejected with its reason.

- O-1 changed: S uses only the 44 test-only AISHELL-3 speakers (speakers absent from `train/content.txt`).
- O-2 changed: Lingua Libre titles matched by `LL-Q\d+ \(cmn\)-<speaker>-<word>`, Q id recorded.
- O-3 changed: listing retries 429 with exponential backoff and asserts the count equals `categoryinfo.size`.
- O-4 changed: the title word is converted with OpenCC t2s before matching; unmatched count logged.
- O-5 changed: words whose CSV rows carry more than one tone sequence are excluded; list reported.
- O-6 changed: a word is in the frame only when its CEDICT-first tone sequence equals the HSK `Pinyin` tones.
- O-7 changed: targets whose differing syllable is a tone 3 next to a tone 3, and words containing 一 or 不, are excluded in W and S.
- O-8 changed: one normaliser maps `u:` and `v` to `ü` for frame and scorer; 女/绿 in the fixtures.
- O-9 changed: erhua entries (trailing `r5`) are excluded.
- O-10 changed: readings lowercased before parsing; every dropped word logged with its reason.
- O-11 changed: no heteronym expansion. Scoring uses exact string match to A or B, then the pypinyin default phrase-aware reading (version pinned in tools.json); a fixture with a rare heteronym.
- O-12 changed: S targets must be a whole jieba token of the reference sentence; substring-only matches counted.
- O-13 changed: per-pair log10 frequency ratio from `packages/corpus/data/parsed-words.json` recorded; every headline result is also reported for the balanced stratum (|log10 ratio| < 0.3) and stated only if it holds there.
- O-14 changed: the primary estimand is paired (swap against own-template on the same item); S restricted per O-1.
- O-15 changed: the context contrast is now within the same token: condition `excised`, the target word cut out of its own AISHELL-3 sentence at the aligner boundaries (with 300 ms silence), against the same word in the sentence. W (Lingua Libre) is reported as a separate population of citation-form words.
- O-16 changed: W-pairs get the reverse swap (B's audio with A's tone), analysed as a 2 by 2.
- O-17 accepted as limitation: the swap changes pitch only; the article says so where the swap result is stated, and the natural-pair arm is the full-cue comparison.
- O-18 changed: template levels scaled to each speaker's own F0 range (p10 to p90 of their voiced frames in the item set) instead of fixed semitones; the distance between template and the item's natural contour recorded per item.
- O-19 changed: for each model, a pair counts only if the model writes B on at least one of: a natural B recording, B said by macOS voices Tingting and Eddy (zh_CN); the exclusion count per model is reported.
- O-20 changed: W intervals resample speakers as clusters.
- O-21 changed: one primary contrast per model and context: share following the spoken tone in swap minus own-template; everything else is labelled exploratory.
- O-22 changed: items whose identity class differs from natural are excluded from swap analysis; the effect is also reported with them.
- O-23 changed: covered by O-15.
- O-24 accepted as limitation: the method reads the transcript only; the rates are named "wrote the word of the spoken tone" and "wrote the expected word", never "heard".
- O-25 changed: covered by O-7 (no swap into a 3-3 context).
- O-26 accepted as limitation: the population is native read speech and four named open models; the article says on its first screen that phone dictation by Google and Apple could not be fed from a file (work/data/engine-probes/ENGINE-PROBES.md).
- O-27 changed: manipulated audio is never published; only pitch points, template points and transcript rows, with the source file's Commons or Hugging Face address and licence.
- O-28 changed: a traditional output is scored on its own reading; t2s is used only when the reading of the converted text equals the original's.
- O-29 changed: the denominator is every item in the cell; all seven class shares are reported beside the two rates.
- O-30 accepted as limitation: per-speaker rates and the largest speaker's share are reported in each table.
- O-31 changed: dedupe by `Simplified`, first CSV row's reading, row ids recorded, frame SHA-256 published.
- O-32 changed: the raw Commons listing is saved with timestamp, category size and SHA-256, and the sample is drawn from that file.
- Rejected in part: O-24's request to score log probabilities of A against B. Paraformer and SenseVoice are non-autoregressive and their FunASR interface returns no sequence score, so the four models cannot be compared on it; the transcript is what an app shows its user.

## 8. Amendments

### A-01 — 2026-11-27T02:05Z, post_hoc: false (no recogniser had transcribed any stimulus)

The dispositions above amend sections 2.1 to 2.8 as stated. Consequences for the expectations:

- E3 is restated on the within-token contrast: for every model the share writing the swapped tone in
  S-sentence is lower than in S-excised (same tokens, same speakers), and at most 0.25 in S-sentence.
  The falsifier and abandonment rules apply to the restated form; the W-versus-S comparison is not a test.
- E1 and E2 now apply to W after the O-5 to O-10 exclusions and the O-19 vocabulary filter.
- The "Not tested" list in 2.4 is evidenced in WORK/data/engine-probes/ENGINE-PROBES.md (Chrome tried
  twice, Android emulator with Speech Services by Google tried once, after H RESEARCH asked).
- S size: 240 sentences from the 44 test-only speakers if the frame allows, at most 8 per speaker;
  otherwise all.
