Library / SDK
sooftware/conformer avatar
sooftware/conformer

Conformer here is the architecture alone, frozen since 2022

[Unofficial] PyTorch implementation of "Conformer: Convolution-augmented Transformer for Speech Recognition" (INTERSPEECH 2020)

1,132 stars192 forksPythonApache-2.0

At a glance

What is it?
This is an unofficial PyTorch implementation of the Conformer speech recognition encoder, deliberately containing model code and nothing else. It is readable and small, and it ships no training loop, no decoder and no reported accuracy.
Who is it for?
This repository suits someone reading the Conformer architecture, teaching it, or slotting an encoder into training code they already run, where numpy and PyTorch as the only dependencies is an advantage. It is the wrong starting point for anyone who wants to transcribe audio, since there is no training loop, no decoder and no pretrained weights, and the README directs that work to a separate toolkit.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 82 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

One architecture file, and nothing around it

This repository is an unofficial PyTorch implementation of the Conformer architecture from the 2020 speech recognition paper. The README states its scope in a single sentence: the repository contains only model code, and training is expected to happen in a separate toolkit the author points at.

That boundary is the most useful thing to understand before cloning it. There is no data pipeline, no training loop, no decoder, no pretrained weights and no evaluation harness. What you get is the network, importable, with the layer structure of the paper expressed in readable PyTorch.

The audience follows from that. Someone studying the architecture and wanting to read it rather than infer it from a large framework. Someone with their own training code who needs an encoder to drop into it. Someone teaching the architecture in a course. Anyone expecting to transcribe audio after installing this will find nothing that does so.

Why convolution and attention were combined

The architectural argument is worth restating because it explains why this design persisted rather than being replaced.

Attention captures relationships between distant positions well and has no particular bias toward nearby ones. Convolution is the reverse: it models local structure efficiently and reaches far only by stacking. Speech has both kinds of structure. Phonetic detail is local, spanning a few frames, while the information that disambiguates a word can sit a long way off. The Conformer design interleaves both so one module handles each, and the README summarises the claim as modelling local and global dependencies together in a parameter-efficient way.

The performance claims in the README belong to the paper, not to this code. The sentence about outperforming previous transformer and convolutional models and reaching leading accuracy describes the published results of the original work. An unofficial reimplementation inherits none of that automatically, because accuracy depends on training data, schedule and hyperparameters that this repository does not contain. Nothing here is misrepresented, and the distinction matters for anyone about to cite a number.

Installing from source and constructing the encoder

Installation is from a checkout rather than a package index, and the README says so directly: only installation from source is supported.

bash
pip install -e .

Prerequisites are minimal and are named individually rather than pinned in a requirements file: numpy, and a PyTorch build matching your own environment, which the README leaves you to select from the PyTorch site. Python 3.7 or higher is recommended along with a fresh virtual environment. A dependency list this short is a consequence of the narrow scope, and it means the package will sit inside an existing project without argument.

Constructing the model takes four arguments, and their names describe the shape of the network rather than a configuration file somewhere.

python
model = Conformer(num_classes=10,
                  input_dim=dim,
                  encoder_dim=32,
                  num_encoder_layers=3).to(device)

A forward pass returns two values, which is the detail most likely to trip someone expecting a single tensor.

python
outputs, output_lengths = model(inputs, input_lengths)

Returning the output lengths alongside the outputs is necessary rather than decorative. The network downsamples in time, so the sequence lengths coming out do not match the ones going in, and a connectionist temporal classification loss needs the true output lengths to align its targets. The README's example wires exactly that, passing the transposed outputs and both length tensors into the loss.

The release history says it stopped in 2022

Two releases exist. Version 1.0 was published on 2022-02-21, and its notes say two things: encoder only, and a README update adding the loss example. A second tag appeared on 2026-01-05 whose only content is an archival deposit, giving the repository a citable identifier.

So the functional state of this code is where it was in early 2022, and the recent activity is archival rather than developmental. The last push was on 2026-06-29.

The phrase encoder only in those notes deserves attention, because the paper describes a full recognition system and what is implemented here is its encoder. Combined with a classification layer and a suitable loss, that is enough to train a recognition model, which is what the example demonstrates. It is not the complete architecture from the paper, and the release notes are the only place that is stated.

A citation file sits in the repository alongside the deposit, so the author expects this to be cited in academic work. For a reimplementation used as a baseline, a stable identifier is genuinely useful, since a repository that changes underneath a published comparison makes that comparison unreproducible. Freezing the code and issuing a citable version is a reasonable way to serve that.

What is missing, and when that matters

The absent pieces are absent by design, and they are still the reason most people should look elsewhere.

There is no training script, so the optimizer, schedule, augmentation and data loading are yours to supply, and those choices decide whether a speech model works at all. There is no decoding, so turning network outputs into text needs a beam search or a language model you bring yourself. There are no pretrained weights, so the starting point is random initialisation and a corpus.

There is also no evaluation of this implementation against the paper. Nothing in the repository reports what word error rate this code reaches on a standard corpus, which is the number that would establish the reimplementation is faithful. That absence is normal for a model-only repository and it means correctness has to be taken on reading rather than on results.

For an embedded use, none of this is a problem. For anyone who wants a working recognition system, all of it is, and the README's pointer to a separate training toolkit is the honest route it offers.

A full speech toolkit is the alternative, and the difference is scope

The comparison is against an established speech recognition toolkit carrying its own Conformer implementation, and the README names the training project it expects you to pair with, alongside references to a widely used research toolkit.

The difference in approach is scope rather than quality. A toolkit ships recipes: download a corpus, train with a known configuration, decode, evaluate, and compare against published numbers, with pretrained checkpoints so you can skip to inference. In exchange you adopt its abstractions, its configuration system and its dependency tree, and reading the model means finding it inside a large codebase.

This repository is the opposite trade. The architecture is a few files you can read in an afternoon, the dependency footprint is numpy and PyTorch, and nothing constrains how you use it. What you give up is everything that turns an architecture into a working system.

Take the toolkit when the goal is a model that transcribes audio. Take this when the goal is understanding the architecture, teaching it, or embedding an encoder into training code you already have and trust.

Apache terms and what to check before relying on it

The project is Apache-2.0 licensed with the file present and the header repeated in the source, which includes an express patent grant and permits commercial use. For an architecture implementation that may end up inside a product, the patent clause is the part that tends to matter in review. This is not legal advice.

The repository is small and orderly: the package, a documentation directory, a setup script, a citation file and the licence. The author follows a documented style convention and says the docstring style exists to generate that documentation, so the code is written to be read.

Two checks are worth making before depending on it. Confirm that the encoder-only scope matches what you need, since the release notes are the only place that limitation appears. Then read the model code against the paper for the parts you care about, because no reported error rate exists to tell you whether the reimplementation is faithful, and reading is the only verification available.

Editorial conclusion

This repository suits someone reading the Conformer architecture, teaching it, or slotting an encoder into training code they already run, where numpy and PyTorch as the only dependencies is an advantage. It is the wrong starting point for anyone who wants to transcribe audio, since there is no training loop, no decoder and no pretrained weights, and the README directs that work to a separate toolkit. Treat the accuracy claims in the README as the original paper's rather than this code's, note that the version 1.0 notes describe the scope as encoder only, and read the model against the paper before depending on it, because no word error rate is reported anywhere in the repository.

Frequently asked questions

Can I transcribe audio with this Conformer implementation?

Not on its own. The README states the repository contains only model code, with no training loop, decoder or pretrained weights, and points to a separate speech toolkit for training. You would supply the data pipeline, training and decoding yourself.

How do I install this Conformer package?

Only installation from source is supported, using an editable install from a checkout of the repository. Prerequisites are numpy and a PyTorch build matching your environment, with Python 3.7 or higher recommended inside a fresh virtual environment.

Why does the Conformer forward pass return two values?

It returns the outputs and the output lengths, because the network downsamples in time so the sequence lengths differ from the input lengths. A connectionist temporal classification loss needs those true lengths to align its targets.

Is this the official Conformer implementation?

No. The repository describes itself as an unofficial PyTorch implementation of the paper. The performance claims quoted in the README describe the published results of the original work rather than measurements of this code.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. sooftware/conformer on GitHub
Community notes

Community notes