---
title: "Optimizing RTC bandwidth estimation with machine learning"
description: "Meta replaced parts of its hand-tuned, GCC-based bandwidth estimation for real-time calls with ML models that classify network conditions and predict congestion, then apply configs tuned offline in simulation and delivered from the server at call setup."
url: "https://swe.quest/articles/optimizing-rtc-bandwidth-estimation-with-machine-learning-1c7f983773fbb82b"
canonical: "https://engineering.fb.com/2024/03/20/networking-traffic/optimizing-rtc-bandwidth-estimation-machine-learning/"
source: "Meta Engineering"
published: "2024-03-20"
difficulty: "hard"
kind: "Case study"
reading_minutes: 8
tags: ["networking","machine-learning","communications","video-media"]
---

# Optimizing RTC bandwidth estimation with machine learning

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2024-03-20, 8 min read, Case study. Original: [https://engineering.fb.com/2024/03/20/networking-traffic/optimizing-rtc-bandwidth-estimation-machine-learning/](https://engineering.fb.com/2024/03/20/networking-traffic/optimizing-rtc-bandwidth-estimation-machine-learning/)

## Summary

Meta replaced parts of its hand-tuned, GCC-based bandwidth estimation for real-time calls with ML models that classify network conditions and predict congestion, then apply configs tuned offline in simulation and delivered from the server at call setup. A combined model feeds time-series network signals through an LSTM and derived metrics through a dense layer, concatenates the two, and classifies random versus congestion packet loss. When loss is random, BWE holds bitrate, ramps up faster and adds FEC. A congestion predictor trained on production logs, labeled with RTT-spike criteria over 4-second past and future windows, fires before delay and loss spikes. A/B tests showed lower connection drops and video freezes and higher video quality, and the team plans to merge the models into one multi-task model.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Communications](https://swe.quest/tags/communications.md) (Domains)
- [Video & media](https://swe.quest/tags/video-media.md) (Domains)

## Prerequisites

- congestion control basics
- WebRTC bandwidth estimation ([easy posts on Communications](https://swe.quest/tags/communications.md?difficulty=easy))
- LSTM neural networks ([easy posts on Machine learning](https://swe.quest/tags/machine-learning.md?difficulty=easy))

## Keywords

WebRTC, Google Congestion Controller, LSTM, PyTorch, FBLearner, forward error correction

## Related posts

- [FastRTC: The Real-Time Communication Library for Python](https://swe.quest/articles/fastrtc-the-real-time-communication-library-for-python-e889b4f612747a64.md): Hugging Face · 2025-02-25 · Medium · 6 min read · Speech & audio, Real-time systems, Python, LLMs
  FastRTC is a Python library for building real-time audio and video AI applications over WebRTC or WebSockets without needing WebRTC expertise.
- [One-second voice-to-voice latency with Modal, Pipecat, and open models](https://swe.quest/articles/one-second-voice-to-voice-latency-with-modal-pipecat-and-open-models-a0369eb06c4f6162.md): Modal · 2025-11-04 · Medium · 12 min read · Speech & audio, Inference & serving, Real-time systems, Performance engineering, RAG & retrieval
  A conversational voice bot on Modal reaches roughly one-second voice-to-voice latency.
- [How we built a realtime system for responsive voice AI in six months](https://swe.quest/articles/how-we-built-a-realtime-system-for-responsive-voice-ai-in-six-months-00acf536a10a0c45.md): OpenAI · 2026-08-03 · Medium · 12 min read · Inference & serving, Real-time systems, Networking, Speech & audio, System design
  GPT-Live replaces turn-detector-based voice AI with a full-duplex voice model that listens and speaks simultaneously, delegating deeper reasoning and tool use to frontier models like GPT-5.5 over an asynchronous RPC path that never blocks media.
- [Reinforcement learning is an infrastructure problem](https://swe.quest/articles/reinforcement-learning-is-an-infrastructure-problem-5f300edd7294912f.md): Modal · 2026-06-01 · Medium · 10 min read · Model training, LLMs, Hardware, Open source
  RL post-training of LLMs is bottlenecked by infrastructure rather than algorithms: training engines, rollout inference and isolated environments must all scale together, and once training goes multi-node, trainer-to-rollout weight sync dominates.
- [How OpenAI delivers low-latency voice AI at scale](https://swe.quest/articles/how-openai-delivers-low-latency-voice-ai-at-scale-fa481a5234e95d30.md): OpenAI · 2026-05-04 · Hard · 13 min read · Networking, Real-time systems, Load balancing, Kubernetes, Speech & audio
  OpenAI rearchitected its WebRTC stack for ChatGPT voice and the Realtime API by splitting a stateless UDP relay from a stateful Go/Pion transceiver that owns ICE, DTLS and SRTP state.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
