Inferensys

Glossary

Paxos

Paxos is a family of consensus algorithms for asynchronous networks that ensures a group of agents can agree on a single value even if some agents fail or messages are delayed.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
CONSENSUS ALGORITHM

What is Paxos?

Paxos is a foundational family of consensus algorithms that enables a group of distributed agents to agree on a single value or sequence of commands, even when some agents fail or network messages are delayed or lost.

Paxos is a fault-tolerant consensus algorithm for asynchronous networks, ensuring a distributed system's safety (all correct agents agree on the same value) and liveness (a value is eventually chosen). It operates through a series of proposal rounds managed by proposer, acceptor, and learner roles. A value is "chosen" when a majority of acceptors promise to accept it, providing resilience to partial failures and network partitions. This makes it a cornerstone for building reliable state machine replication and distributed databases.

Within multi-agent system orchestration, Paxos provides the formal mechanism for conflict resolution where agents must converge on a single decision, such as electing a leader or committing a transaction. Its variants, like Multi-Paxos, optimize for repeated consensus on a log of commands. While complex, its guarantees are critical for systems requiring strong consistency, directly relating to the CAP theorem's trade-offs and forming the basis for later algorithms like Raft, which prioritizes understandability.

CONSENSUS MECHANISM

Key Features of Paxos

Paxos is a foundational family of consensus algorithms that enables a group of distributed agents to agree on a single value or sequence of values, even in the presence of faults and network delays. Its design is built upon several core concepts that ensure safety and liveness.

01

Safety and Liveness Guarantees

Paxos provides two fundamental guarantees. Safety ensures that if a value is chosen, it is the only value that can be chosen, preventing contradictory decisions. Liveness ensures that, provided a majority of agents are functioning and can communicate, a value will eventually be chosen. These properties make Paxos a cornerstone for building reliable distributed systems where consistency is non-negotiable.

02

Majority Quorums

Paxos operates on the principle of majority quorums. For any decision (proposal acceptance or value commitment), a quorum—a majority of the participating agents—must agree. This design ensures progress can be made even if some agents fail or are partitioned from the network. A key insight is that any two quorums must intersect in at least one agent, which is critical for maintaining consistency and preventing conflicting decisions.

03

Roles: Proposers, Acceptors, and Learners

The algorithm defines three distinct logical roles:

  • Proposers: Initiate proposals for a value.
  • Acceptors: Form the quorums that vote on and accept proposals.
  • Learners: Learn the final chosen value. A single physical agent can play multiple roles. This separation of concerns clarifies the protocol's phases and is a key reason for its analyzability and widespread adoption in systems like distributed databases and configuration stores.
04

Two-Phase Protocol (Prepare/Promise & Accept/Accepted)

Paxos achieves consensus through a two-phase protocol:

  1. Prepare/Promise Phase: A proposer sends a Prepare request with a unique, monotonically increasing proposal number. Acceptors promise not to accept any proposal with a lower number and reply with the highest-numbered proposal they have already accepted (if any).
  2. Accept/Accepted Phase: If the proposer receives promises from a majority quorum, it sends an Accept request for a value (often the value from the highest-numbered proposal reported). If a majority of acceptors then accept this request, the value is chosen.
05

Leader Optimization (Multi-Paxos)

In its basic form, Paxos can be inefficient for agreeing on a sequence of values (a log). Multi-Paxos is a common optimization where a stable leader is elected to act as the sole proposer for a sequence of consensus instances. This eliminates the prepare phase for most instances after the first, dramatically improving throughput and latency. The leader must still be fault-tolerant and can be replaced if it fails.

06

Asynchronous Network Model

Paxos is designed for an asynchronous network model, where messages can be arbitrarily delayed, duplicated, or lost, but are not corrupted. It makes no timing assumptions, which is crucial for real-world deployments. This model means Paxos cannot guarantee progress within a bounded time (a consequence of the FLP impossibility result), but it guarantees that if communication stabilizes, a value will be chosen, making it extremely robust.

CONSENSUS MECHANISMS FOR AI

How Does Paxos Work?

Paxos is a foundational family of consensus algorithms that enables a group of distributed agents to agree on a single value or sequence of commands, even when some agents fail or network messages are delayed or lost.

The core algorithm operates through proposals and promises managed by three agent roles: Proposers, Acceptors, and Learners. A proposer initiates agreement by sending a prepare request with a unique, increasing proposal number to a majority of acceptors. If an acceptor receives a prepare request with a number higher than any it has previously promised, it responds with a promise not to accept older proposals and may include the value of the highest-numbered proposal it has already accepted. This phase establishes a leader and gathers any previously accepted state.

Upon receiving promises from a majority, the proposer sends an accept request containing its proposal number and a value. Crucially, this value must be the one from the highest-numbered proposal reported in the promises, ensuring safety. Acceptors then accept this request if they have not promised to ignore it. Once a majority of acceptors accept the same proposal, the value is chosen and can be reliably learned by all learners. This two-phase structure guarantees that only one value can be chosen, providing fault tolerance in asynchronous networks.

CONSENSUS ALGORITHMS

Frequently Asked Questions

Paxos is a foundational family of consensus algorithms for asynchronous networks. These questions address its core mechanics, practical applications, and how it compares to modern alternatives.

Paxos is a family of consensus algorithms that enables a group of distributed agents (or processes) in an asynchronous network to agree on a single value despite the failure of some participants or delayed messages. It works through a series of proposal rounds, each with two key phases: a Prepare/Promise phase and an Accept/Accepted phase. In the first phase, a proposer seeks promises from a majority of acceptors not to accept older proposals. If successful, in the second phase, it proposes a value, which is accepted by a majority, achieving irrevocable consensus. The protocol's safety is guaranteed as long as a majority of agents remain operational, while liveness requires a distinguished leader (or proposer) to make progress.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.