Overview
Voice typing on a phone, auto captions and meeting transcripts all rely on speech recognition. The 1920s toy Radio Rex already jumped out of its kennel when called, but only because a spring let go at sounds around 500 Hz; it took nearly a hundred years for machines to write down what was said. This video follows that history in two halves: first, recognizers built from separate modules for the “ear” and the “brain”, and then single neural networks that learn everything from data.
The middle of the video (5:39–16:08) is a sponsored segment for Typeless, a voice-input app, used to dictate instructions to Claude Code that built the video and open-source pages of this portfolio.
Key Points
- Audio is just a sequence of numbers, typically 16,000 per second, with no word boundaries. Recognition looks for the word sequence W with the highest P(W|X), and Bayes’ theorem turns this into P(X|W) × P(W): an acoustic model (the ear) and a language model (the brain), which can be trained on text alone. Accuracy is measured by word error rate, which ranges from 1–2 errors per 100 words on read speech to about 1 in 4 on a distant microphone at a dinner party.
- The waveform is cut into 25 ms frames every 10 ms (100 per second) and turned into a spectrogram with the FFT (Cooley and Tukey, 1965). Grouping frequencies on the mel scale and taking the log gives the log-mel spectrogram that most models use today; older recognizers used 39-number MFCC vectors.
- Bell Labs’ Audrey (1952) matched spoken digits against stored templates. DTW, a dynamic programming method (Vintsyuk in 1968, then NEC’s Sakoe and Chiba in 1971), absorbed differences in speaking speed, but templates had to be remade for every speaker and every new word.
- In the early 1970s, James Baker at Carnegie Mellon and Frederick Jelinek’s group at IBM brought hidden Markov models to speech; Baker went on to co-found Dragon Systems in 1982. By the 1990s the standard recognizer was a pipeline: an HMM-GMM acoustic model, a pronunciation dictionary, an n-gram language model and a Viterbi beam search, later compiled into a single WFST graph in toolkits such as Kaldi (2011).
- Neural networks first replaced only the GMM. With GPUs, deep networks from Hinton’s group and others overtook GMMs on large-vocabulary tasks by 2012, but the modules were still trained separately, so errors flowed from one to the next.
- End-to-end models removed the pipeline. CTC (Graves and colleagues, 2006) adds a “blank” symbol and sums over every alignment, so it learns from audio and text pairs alone. Google’s Listen, Attend and Spell used attention to write one character at a time without a dictionary or language model, but had to wait for the speaker to finish. The RNN Transducer adds a prediction network so text appears while you speak, and Google put it on-device in Gboard in 2019; Conformer (2020) added convolution to Transformer blocks.
- The focus then moved to data. wav2vec 2.0 and HuBERT learn by predicting masked audio, while OpenAI’s Whisper (2022) trained on 680,000 hours of web audio and captions. With special tokens for language, task and timestamps, one model transcribes, translates into English and detects speech, and it makes 55% fewer errors on average than a model trained only on read speech when tested on other datasets. It can also loop or invent text it never heard.
- Speech LLMs, such as Qwen-Audio, feed an audio encoder (often Whisper’s) through a small adapter layer into an LLM, so transcription becomes one task among summarizing, answering questions and recognizing emotion. Results still swing with how the instruction is worded, and reasoning is weaker than when the same content is given as text.
Chapters
- 0:00 Introduction: from Radio Rex to Whisper
- 1:01 Chapter 1: The problem speech recognition solves
- 5:39 Sponsored: building this portfolio with Typeless
- 16:34 Chapter 2: Turning sound into numbers
- 18:36 Chapter 3: The age of template matching
- 20:15 Chapter 4: HMMs and the pipeline
- 23:34 Chapter 5: Neural networks arrive
- 25:21 Chapter 6: CTC
- 27:11 Chapter 7: Attention
- 28:49 Chapter 8: Transducers
- 30:02 Chapter 9: Whisper and large-scale data
- 33:01 Chapter 10: Speech LLMs
- 34:15 Summary
概要
スマートフォンの音声入力も、動画の自動字幕も、会議の議事録も、音声認識という同じ技術で作られています。1920年代のおもちゃRadio Rexは、名前を呼ぶと小屋から犬が飛び出しましたが、それは500Hzあたりの音でバネが外れるだけの仕掛けでした。機械が話した言葉を文字にできるようになるまでには、そこから100年近くかかります。この動画では、その歴史を2つに分けてたどります。前半は「耳」の役と「頭」の役を別々のモジュールで作った時代、後半は全部を1つのニューラルネットワークにまとめてデータから学ばせる時代です。
動画の途中(5:39〜16:08)は音声入力アプリTypelessの提供パートで、Typelessで話した指示をClaude Codeに渡し、このポートフォリオの動画ページとOSS活動のページを作っています。
ポイント
- マイクが拾った音は、コンピューターの中では1秒に1万6,000個ほどの数の列で、単語の切れ目は書いてありません。音声認識は、音声Xに対して確率P(W|X)が一番高い単語の並びWを探す問題で、ベイズの定理を使うとP(X|W)×P(W)に置き換えられます。これが音響モデル(耳)と言語モデル(頭)で、言語モデルは文章だけで学習できます。精度は単語誤り率で測り、朗読なら100単語に1〜2個の誤りですが、食事会を離れたマイクで録った音声では4単語に1つ近く間違えます。
- 波形は25ミリ秒の区間を10ミリ秒ずつずらして切り出し(1秒に100フレーム)、FFT(1965年、クーリーとテューキー)でスペクトログラムにします。周波数をメル尺度でまとめて対数を取ったログメルスペクトログラムが、今の多くのモデルの入力です。以前の認識器は39個の数からなるMFCCを使っていました。
- 1952年のベル研究所のAudreyは、数字の音を取っておいた型紙と比べて聞き分けました。話す速さの違いは動的計画法を使うDTW(1968年に旧ソ連のヴィンツュク、1971年にNECの迫江と千葉)で吸収しましたが、話す人や単語が変わるたびに型紙を作り直す必要がありました。
- 1970年代の前半、カーネギーメロン大学のジェームズ・ベイカーとIBMのフレデリック・ジェリネクのグループが、隠れマルコフモデル(HMM)を音声に当てはめました。ベイカーは1982年にDragon Systemsを共同で創業しています。1990年代には、HMMとGMMの音響モデル、発音辞書、N-gramの言語モデル、ビタビのビーム探索を組み合わせたパイプラインが標準になり、のちにKaldi(2011年)などのツールキットで1枚のWFSTのグラフにまとめられました。
- ニューラルネットワークは、最初はGMMの代わりとしてだけ入りました。GPUで深いネットワークを学習できるようになり、2012年までにはヒントンたちのディープニューラルネットワークが大きな語彙の認識でGMMを上回ります。それでもモジュールは別々に学習するので、前のモジュールの間違いは後ろへそのまま流れていきました。
- エンドツーエンドのモデルがパイプラインをなくします。CTC(2006年、グレイブスたち)は何も出さないことを表すブランクを使い、あり得る全ての並び方の確率を足し合わせることで、音声と文字の組だけで学習できるようにしました。GoogleのListen, Attend and Spellはアテンションを使い、発音辞書も言語モデルもなしに1文字ずつ書きますが、話し終わるまで書き始められません。RNNトランスデューサーは予測ネットワークを足して話しながら文字を出せるようにし、Googleは2019年にこれを通信なしで動く形でGboardに載せました。2020年のConformerは、Transformerのブロックに畳み込みを足した構造です。
- 関心は次に学習データの量へ移ります。wav2vec 2.0やHuBERTは隠した音声を当てさせて学び、OpenAIのWhisper(2022年)はインターネットの音声と字幕の組を68万時間集めて学習しました。言語、仕事、時刻を表す記号を使い分けることで、1つのモデルが書き起こし、英語への翻訳、声があるかどうかの判定までこなし、他の評価データでは朗読のデータだけで学習したモデルより誤りが平均55%少なくなりました。一方で、同じ言葉を繰り返したり、聞こえていない文を書いたりすることがあります。
- Qwen-Audioのような音声LLMは、音声エンコーダー(よくWhisperのものが使われます)の出力を小さな変換の層でLLMに渡します。書き起こしは、要約や質問への答え、感情の判定と並ぶ仕事の1つになりました。ただし、指示の言い方を少し変えるだけで結果がぶれ、同じ内容を文字で渡した場合より推論の正答率が下がるという報告もあります。