Papers › Keyword Transformer: A Self-Attention Model for Keyword Spotting

Keyword Transformer: A Self-Attention Model for Keyword Spotting

1 Apr 2021arXiv:2104.00769archive 2025-07-28

Axel Berg, Mark O'Connor, Miguel Tairum Cruz

The Transformer architecture has been successful across many domains, including natural language processing, computer vision and speech recognition. In keyword spotting, self-attention has primarily been used on top of convolutional or recurrent encoders. We investigate a range of ways to adapt the Transformer architecture to keyword spotting and introduce the Keyword Transformer (KWT), a fully self-attentional architecture that exceeds state-of-the-art performance across multiple tasks without any pre-training or additional data. Surprisingly, this simple architecture outperforms more complex models that mix convolutional, recurrent and attentive layers. KWT can be used as a drop-in replacement for these models, setting two new benchmark records on the Google Speech Commands dataset with 98.6% and 97.7% accuracy on the 12 and 35-command tasks respectively.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

The archive's official repository (ARM-software/keyword-transformer) was not harvested; the 16 samples below come from 5 community repositories.

Syntology 16 code samples harvested from 5 repositories linked to this paper: 14 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 0 honoured, 0 violated, 13 with no contract checked; 1 where Syntology's instrument failed) · 2 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 16 samples from 5 repositories, 14 ran (13 with no instrument failure; 1 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

ARM-software/keyword-transformer officialmentioned in papermentioned on GitHubtfApache-2.0Syntology: not harvested report
Arizona-Voice/Arizona-spotting mentioned on GitHubpytorchMITSyntology: 3 samples, 3 ran (0 instrument-failed) · 0 unverified report
ID56/Torch-KWT mentioned on GitHubpytorchMITSyntology: 9 samples, 8 ran (0 instrument-failed) · 1 unverified report
aau-es-ml/ssl_noise-robust_kws mentioned on GitHubpytorchSyntology: not harvested report
holgerbovbjerg/data2vec-kws mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language (arXiv:2202.03555; that paper's own run record: 4 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 0 violated, 4 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
intelligentmachines/keyword_spotting_transformer mentioned on GitHubtfApache-2.0Syntology: 2 samples, 2 ran (0 instrument-failed) · 0 unverified report
mashrurmorshed/torch-kwt mentioned on GitHubpytorchSyntology: 1 sample, 0 ran · 1 unverified report
phanxuanphucnd/Arizona-spotting mentioned on GitHubSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
EscVM/EscVM_YT tfApache-2.0Syntology: not harvested report
KrishnaDN/Keyword-Transformer Syntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

16 samples harvested: 14 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 0 honoured, 0 violated, 13 with no contract checked; 1 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · our draft was wrong
13ran
2unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

Arizona-Voice/Arizona-spotting community (archive-listed) 3 samples, 3 ran (0 instrument-failed) · 0 unverified
get_from_registry arizona_spotting/utils/misc_utils.py ran MIT (permissive) · 90190d4490581c2d · report fixture: signature key:str/0/str, registry:dict/0/? · returned Linear · level recorded 2026-09-24
ifnone in 6 papers arizona_spotting/utils/misc_utils.py ran fingerprinted MIT (permissive) · ea6f42601b6cb44e · report fixture: signature a:str/0/str, b:str/0/str · returned str · level recorded 2026-09-24
str2bool in 533 papers arizona_spotting/utils/misc_utils.py ran MIT (permissive) · 9e0b1e5fd4f77016 · report fixture: signature value:str/0/str · returned bool · level recorded 2026-09-24
ID56/Torch-KWT community (archive-listed) 9 samples, 8 ran (0 instrument-failed) · 1 unverified
calc_step utils/misc.py ran fingerprinted MIT (permissive) · 12d715bdf737f38c · report fixture: signature epoch:int/0/int, n_batches:int/0/int, batch_index:int/0/int · returned int · level recorded 2026-09-24
count_params in 80 papers utils/misc.py ran MIT (permissive) · 854b6b5cf6315fbc · report fixture: signature model:callable/0/? · returned int · level recorded 2026-09-24
evaluate in 514 papers utils/trainer.py ran MIT (permissive) · 40175e67a61190d6 · report fixture: signature net:callable/0/?, criterion:callable/0/?, dataloader:DataLoader/0/?, device:device/0/? · returned tuple · level recorded 2026-09-24
get_optimizer in 228 papers utils/opt.py ran MIT (permissive) · d65ca06fe0124125 · report fixture: signature net:callable/0/?, opt_config:dict/0/? · returned AdamW · level recorded 2026-09-24
get_scheduler in 122 papers utils/scheduler.py ran MIT (permissive) · d836a387836b9a38 · report fixture: signature optimizer:SGD/0/?, scheduler_type:str/0/str, T_max:int/0/int · returned CosineAnnealingLR · level recorded 2026-09-24
get_train_val_test_split utils/dataset.py ran MIT (permissive) · 207ecf57a690304c · report fixture: signature root:str/0/str, val_file:str/0/str, test_file:str/0/str · returned tuple · level recorded 2026-09-24
kwt_from_name models/kwt.py ran MIT (permissive) · d1bdc96cc20606ef · report fixture: signature model_name:str/0/str · returned KWT · level recorded 2026-09-24
train_single_batch utils/trainer.py ran MIT (permissive) · 1aa66761878693ca · report fixture: signature net:callable/0/?, data:Tensor/2/float, targets:Tensor/1/int, optimizer:SGD/0/?, criterion:callable/0/?, device:device/0/? · returned tuple · level recorded 2026-09-24
get_config in 203 papers config_parser.py unverified MIT (permissive) · d203ddadc113d9d6 · report
intelligentmachines/keyword_spotting_transformer community (archive-listed) 2 samples, 2 ran (0 instrument-failed) · 0 unverified
get_label in 36 papers preprocessing.py ran Apache-2.0 (permissive) · 4a28eb83a542016f · report fixture: signature file_path:str/0/str · returned EagerTensor · level recorded 2026-09-24
load_files in 10 papers preprocessing.py ran Apache-2.0 (permissive) · cce294fcacc4be3b · report fixture: signature data_dir:str/0/str · returned tuple · level recorded 2026-09-24
mashrurmorshed/torch-kwt community (archive-listed) 1 sample, 0 ran · 1 unverified
get_preds in 18 papers inference.py unverified MIT (permissive) · 43893718a859b6fe · report
phanxuanphucnd/Arizona-spotting community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
find_consecutive_values demo/app_kws.py ran · our draft was wrong MIT (permissive) · 189d634a5204c3ef · report fixture: signature data:list/1/int · returned list · level recorded 2026-09-22

Tasks

Keyword SpottingSpeech Recognition

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Keyword Spotting Google Speech Commands KWT-3 Google Speech Commands V1 12 97.49 ±0.15 #5 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-3 Google Speech Commands V2 12 98.56 ±0.07 #5 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-3 Google Speech Commands V2 35 97.69 ±0.09 #5 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-2 Google Speech Commands V1 12 97.27 ±0.08 #8 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-2 Google Speech Commands V2 12 98.43±0.08 #8 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-2 Google Speech Commands V2 35 97.74 ±0.03 #8 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-1 Google Speech Commands V1 12 97.26±0.18 #9 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-1 Google Speech Commands V2 12 98.08±0.10 #9 of 42 Archive leaderboard report
Keyword Spotting Google Speech Commands KWT-1 Google Speech Commands V2 35 96.95±0.14 #9 of 42 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections