Pluton.id
Notes

Running Speech Recognition on the Phone Instead of a Server: What It Costs Us

On-device ASR can improve privacy and enable offline transcription, but it shifts costs into the app, the device, and our engineering workflow.


Why we consider on-device ASR

Speech recognition is often implemented as a simple client-server feature: the phone records audio, uploads it, and receives text. Moving that work onto the phone changes the architecture substantially. The application becomes responsible for audio processing, model execution, and device-specific performance rather than treating speech recognition as a remote dependency.

We usually consider on-device ASR when privacy, offline operation, response time, or data-transfer constraints matter more than having one centrally managed recognition service.

What we gain

Privacy by default

With on-device ASR, raw audio can remain on the user’s phone. That reduces the need to send voice recordings through our infrastructure and narrows the set of systems that can access sensitive speech.

This is useful, but we avoid describing it as automatic privacy compliance. The transcript itself may still be sensitive. If the app stores, synchronizes, logs, or submits recognized text, we still need to decide how that data is handled.

Keeping audio on the device reduces one category of exposure. It does not remove the need for a privacy design.

Offline behavior

A local model can recognize speech without an active connection. That makes the feature available in unreliable network conditions and avoids making basic interaction depend on server reachability.

Offline support also changes the product contract. We need to define whether every language works offline, whether punctuation is available locally, and what happens when the model for a selected language has not been downloaded yet.

Lower network dependency

We no longer upload every recording for processing. This can reduce backend traffic, but it does not mean the feature is free. We exchange recurring server work for app download size, local computation, and more work in the mobile codebase.

What it costs us

Application size

Speech models are assets, and useful models are not small compared with ordinary application resources. Including them in the initial install increases the app package. Downloading them after installation keeps the initial package smaller but introduces model delivery, storage management, versioning, and failure handling.

We generally choose between these approaches:

  • Bundle a small default model when offline availability is essential from first launch.
  • Download language models on demand when users may need different languages.
  • Remove unused downloaded models only when users can clearly understand the consequence and recover without surprise.

Memory, battery, and heat

Recognition consumes CPU, GPU, neural acceleration hardware, or a combination of them. The cost varies significantly by phone, operating system version, model format, audio duration, and whether recognition runs continuously or only after an explicit action.

We need to test more than whether a transcript appears. We also need to observe what happens when the device is warm, in low-power mode, under memory pressure, or running other applications. A model that works well in a short development demo can be disruptive during long recordings on an older phone.

Device variability

A server gives us a controlled execution environment. On-device ASR gives us a fleet of different processors, available memory levels, hardware accelerators, microphone behavior, and operating-system scheduling rules.

That means we need fallback behavior. We may use a smaller model, disable real-time partial results, limit maximum recording duration, or offer server processing only after obtaining an appropriate user choice. The right fallback depends on the product, but assuming every phone can run the same model is usually the expensive mistake.

Accuracy trade-offs

Local models are often selected partly for their footprint and speed. Those constraints can affect recognition quality, supported languages, punctuation, speaker handling, and performance in noisy environments.

We should evaluate the actual speech our users produce, including accents, vocabulary, background noise, and short commands versus longer dictation. A general benchmark is useful for comparison, but it is not evidence that the selected model works for our use case.

Engineering and release work

Running ASR locally adds mobile-specific responsibilities:

  • Capturing audio at the format expected by the model.
  • Resampling and chunking audio without introducing gaps or excessive latency.
  • Managing model files, checksums, downloads, and storage limits.
  • Running inference away from the user-interface thread.
  • Testing across supported device classes and operating-system versions.
  • Handling interrupted recording, backgrounding, permissions, and audio-route changes.

These tasks exist even when a framework makes inference look simple.

Where ONNX fits

ONNX can be a practical model interchange format when we want to run an exported speech model across more than one platform. With an ONNX-compatible runtime, we can keep a model pipeline that is not tightly coupled to the training framework.

In practice, ONNX is not a guarantee that a model will run efficiently on every phone. We still need to verify supported operators, model conversion output, runtime versions, hardware execution providers, and quantization behavior. A conversion that is valid can still be slower, larger, or less accurate than expected.

We treat the following as separate validation steps:

  1. Export the model to ONNX and confirm that inference produces expected output.
  2. Run the model through the target mobile runtime.
  3. Measure startup behavior, memory use, and recognition responsiveness on representative devices.
  4. Compare transcript quality before and after any quantization or optimization.
  5. Test model updates independently from app updates when models are delivered separately.

Quantization is often worth evaluating because it can reduce storage and execution cost. It can also change accuracy or expose unsupported runtime paths. We do not enable it solely because a conversion tool offers the option.

Privacy has operational costs too

On-device processing reduces the amount of audio we need to operate as a service, but it can make diagnosis harder. With server ASR, we may inspect controlled logs and reproduce issues using centrally managed inputs, subject to data-handling rules. With local processing, we need other ways to understand failures without quietly collecting speech.

We can use approaches such as:

  • User-approved diagnostic uploads.
  • Local error codes that describe model and runtime failures without including audio.
  • Synthetic and consented test recordings for regression testing.
  • Clear controls for deleting local recordings, transcripts, and downloaded models.

This is a trade-off we should make explicit: stronger privacy can reduce automatic observability. We need to build enough diagnostics for support without undermining the privacy reason for processing locally.

Choosing between local, server, and hybrid ASR

We do not treat on-device ASR as a universal replacement for server recognition.

Local recognition is usually a strong fit when offline operation is required, audio is especially sensitive, interaction needs immediate feedback, or supported languages and use cases are narrow enough for a local model.

Server recognition is often simpler when model quality must improve centrally, many languages are needed, recordings are long, or the product can reliably depend on connectivity and a data-processing path.

A hybrid design can be useful, but only if its behavior is clear. For example, we can perform a local first pass and offer an optional higher-capacity server pass. We should not silently upload audio after presenting the feature as private or offline.

Our implementation checklist

Before committing to on-device ASR, we work through these questions:

  • Which recordings must work offline?
  • Which languages, accents, and domains do we actually need to support?
  • What is the maximum acceptable app-download and on-device-storage impact?
  • Which devices are part of our supported baseline?
  • What happens when there is insufficient storage, memory, or battery?
  • Does the model use ONNX or another runtime format that is maintained on our target platforms?
  • Can we update a model safely and roll back a problematic version?
  • Which diagnostic signals can we collect without collecting speech content?
  • When, if ever, can a user choose server processing?

The practical conclusion

On-device ASR is not merely a deployment change. It moves responsibility from infrastructure into the application and onto user hardware. In return, we can offer offline use, reduce audio transfer, and make privacy easier to support in the system design.

The cost is real: larger installs, device testing, power and memory constraints, model lifecycle work, and less straightforward observability. We get the best result when we choose local speech recognition for specific reasons, validate it on real target devices, and define the privacy and fallback behavior before shipping it.