Alphabeta Math
AlgorithmAlgorithm: AI-adaptedProof: Not applicablePipeline-generatedjudge pass (gpt-6-luna)
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Finite-budget direct preference optimization by mini-batch gradient descent

Definition

Input a finite ordered preference dataset D=((xi,yiw,yil))i=1n with n≥1, finite response sets Yxi of size at least two, distinct yiw,yil∈Yxi, reference probability vectors qxi with all coordinates positive, a coefficient β>0, a parameter domain Θ⊆Rd that is open, and a conditional policy family πθ(⋅∣xi) that is a probability vector with all coordinates positive on each Yxi for every θ∈Θ, with coordinates totally differentiable in θ and continuous derivative. Also input an initial value θ0∈Θ, a finite integer T≥0, a list of finite nonempty mini-batches Bt=(it,1,…,it,mt) with indices in {1,…,n} for each 0≤t<T, and finite step sizes ηt≥0. Duplicated indices in a mini-batch are allowed. Require each observed scalar log-probability θ↦log⁡πθ(yiw∣xi) and θ↦log⁡πθ(yil∣xi) to be represented by a finite real-arithmetic graph whose primitive maps are totally differentiable with continuous derivative matrices on an open neighborhood of every evaluated parameter; a piecewise-C1 primitive is allowed only on a unique strict branch.

Also supply an exact membership oracle MΘ:Rd→{0,1} that returns 1 exactly on Θ and terminates on every call, with finite declared per-call cost cΘ(z). Use this oracle for the candidate-parameter test below. Supply terminating exact evaluators for the policy-graph primitive values, derivative-transpose applications, and primitive-domain and strict-branch tests. In the work model, each such primitive call and each scalar arithmetic operation, comparison, exponential, logarithm, maximum, or absolute value costs one unit; vector operations count their scalar entries. Membership-oracle calls are counted separately and their costs added. These supplied oracle operations are part of the input model; openness of Θ alone is not asserted to provide a computable membership test, nor is a bit-complexity or floating-point bound asserted.

For real u, evaluate the per-record loss by the equivalent stable expression s(u)=max⁡(0,−u)+log⁡(1+e−∣u∣)=log⁡(1+e−u). Set ui(θ)=β[log⁡(πθ(yiw∣xi)/qxi(yiw))−log⁡(πθ(yil∣xi)/qxi(yil))] and initially compute LD(θ0)=n−1∑is(ui(θ0)). Store (θlast,Llast)=(θ0,LD(θ0)).

For t=0,…,T−1, compute the mini-batch objective Lt(θ)=mt−1∑j=1mts(uit,j(θ)). For each index in the batch, use reverse-mode AD on the finite policy-log-probability graphs to compute the Euclidean gradients of the two log probabilities, and form the exact loss gradient from the finite DPO gradient formula proved on the A page: gt=−βmt∑j=1mtσ(−uit,j(θt))(∇θlog⁡πθt(yit,jw∣xit,j)−∇θlog⁡πθt(yit,jl∣xit,j)). Do not differentiate through the max/absolute-value expression used only to evaluate s(u); use this explicit derivative formula. If reverse mode returns DOMAIN_ERROR or NONDIFFERENTIABLE, stop and return (θlast,Llast) with that status. Otherwise set θ′=θt−ηtgt. Evaluate MΘ(θ′). If its value is 0, so θ′∉Θ, stop and return the last valid pair with status DOMAIN_ERROR. If its value is 1, so θ′∈Θ, set θt+1=θ′, evaluate LD(θt+1), and update (θlast,Llast)=(θt+1,LD(θt+1)).

After all T updates, return (θT,LD(θT)) with status COMPLETED. Thus T=0 returns the initial parameters and initial full-data loss. The procedure uses the fixed mini-batch indices and step-size schedule as supplied; it makes no convergence or statistical-optimality assertion.

Definition references

Finite-budget DPO preserves its valid pair and terminates with finite oracle work ↗: proves well-definedness, the stored valid-pair invariant, the exact mini-batch gradient, finite termination, and the work and membership-oracle bounds under the declared input model.

Finite Bradley–Terry preference model: defines the pairwise comparison probability and sigmoid.

DPO reward-policy reparameterization and gradient: supplies the exact finite DPO loss gradient.

Finite real-arithmetic program: fixes the finite topological graph and real-arithmetic conventions, and allows a primitive to be piecewise C1 only on a unique strict branch.

Continuously differentiable Euclidean maps: C1 means total differentiability with continuous derivative matrix.

Reverse-mode automatic differentiation: specifies the reverse sweep for a finite scalar-output C1 graph.

Reverse mode computes the graph gradient: confirms the returned cotangents are the exact derivative on each fixed strict branch.

Rafailov et al., §4 Eq. (7), Appendix B implementation

Purdue PrefOpt course notes, §4a

Remarks

This is a finite real-arithmetic update procedure. The equivalent loss-value expression and procedure properties are justified by the separate result listed above. The gradient is computed from the explicit smooth formula, so the max/absolute-value implementation branch at u=0 is not differentiated. No floating-point error bound, minimizer attainment, convergence rate, or generalization guarantee is asserted.

Depends on

Used by

Dependency tree · two levels

16 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources