The Parallelism Tradeoff: Limitations of Log-Precision Transformers
William Merrill, Ashish Sabharwal
Introduction
This work aims to characterize the computational model implicit in transformer neural networks (Vaswani et al., 2017), which form the basis of recent breakthroughs in large language models such as BERT Devlin et al. (2019), T5 Raffel et al. (2020), and GPT-3 Brown et al. (2020). What computational primitives can the transformer’s components implement, and what problems can the full system solve in aggregate? These questions are important for interpreting transformers in a principled way, understanding potential limitations of their reasoning capabilities, and building trust in deployed transformer-based systems.
Early theoretical work on transformers established their Turing completeness, albeit with assumptions like infinite precision and arbitrarily powerful feedforward subnets (Pérez et al., 2019; Dehghani et al., 2019). On the other hand, a strand of more recent work uses techniques from circuit complexity theory to derive strong limitations on the types of problems transformers can solve given restrictions on the form of attention allowed in the transformer. Specifically, Hahn (2020) and Hao et al. (2022) showed transformers restricted to hard attention are very limited: they can only solve problems in a weak complexity class (non-uniform ) that doesn’t even contain basic problems like majority of bits. Merrill et al. (2022) extended this to a more general class of “saturated attention” transformers with a floating point datatype, and showed a larger class of problems (non-uniform ) as an upper bound. This motivates analyzing a setting that strikes a middle ground: Can we characterize transformers whose precision and feedforward nets’ computational power are realistically bounded, but where attention is also realistically expressive?
An important practical limitation of these prior results is the “non-uniform” nature of the considered circuit classes, which makes these classes non-realizable and the findings difficult to interpret. This is because non-uniform and , while highly limited in computation, also contain some problems that are not even decidable, i.e., for which there doesn’t exist any exact algorithm. Thus, non-uniform classes cannot be directly compared with standard algorithmic complexity classes such as , , etc. This motivates our second key question: Can we derive uniform upper bounds on transformers?
Our main contribution is proving that log-precision transformers can be simulated by uniform constant-depth threshold circuits. Thus, such transformers can only solve problems in uniform . This characterization is strikingly weak compared to the Turing-completeness of infinite-precision transformers. Since we believe log precision is more realistic for practical transformers than infinite precision, these results point to the conclusion that transformers are not Turing-complete in practice.
In contrast to past results, our upper bound on transformers is a uniform circuit class, enabling direct comparison of log-precision transformers to many natural complexity classes. These connections reveal specific problems that define the upper limits of log-precision transformers’ capabilities, as discussed further in § 2.
Intuitively, our upper bound says that log-precision transformers are computationally shallow, and that this shallowness can be understood to emerge from their parallelizability. Transformers’ inherent parallelism is useful for training them efficiently at massive scale, but may limit the complexity of the computations they can express. We introduce the term parallelism tradeoff to capture this idea, which represents a potential fundamental weakness of the current paradigm of scaling language models. Formally characterizing reasoning capabilities relevant to language models and understanding whether they likely fall outside upper bounds implied by the tradeoff would clarify the practical implications of this limitation of scaling.
It could also be that the limitations of parallelism are not a curse but a blessing, if they constrain the hypothesis space in a way useful for learning. We have no evidence that this is true, but mention it as an alternate interpretation of the results that could be clarified in future work.
Instruction Following and Advice Transformers.
We also consider an instruction following setting (Brown et al., 2020) where the transformer is provided the description of a task along with an input on which to execute the instruction. We construct a practically parameterizable transformer that can execute instructions perfectly if they are provided in the form of circuits. This complements recent work that studies transformers’ ability to follow other forms of instructions such as regular expressions (Finlayson et al., 2022).
Based on the fundamental property that transformers can correctly evaluate any given circuit on a given input, we introduce the notion of advice transformers akin to advice taking Turing machines. We show that transformers can recognize any (non-uniform) language if provided appropriate poly-size advice.
In summary, our findings provide new insights on both the abilities and the limitations of transformers, and bring out bounded precision, threshold computations, and parallelism as key notions for understanding the implicit computational model of transformers in practice.
Roadmap.
Before diving into technical details, we discuss in § 2 the implications of our results on both fundamental as well as practical abilities of transformers. § 3 provides a brief primer on circuits as a model of computation. It then discusses a way of serializing a circuit into a string; we later show how to generate such serializations using a resource-bounded algorithm, which is the key to proving containment of transformers in uniform circuit classes. § 4 defines our formal model of bounded-precision transformers. § 5 derives our first formal bound on log-precision transformers. This bound involves non-uniform circuit families, similar in spirit to prior results in this area. § 6 proves our more technical main result: the first uniform circuit complexity upper bound for transformers (specifically, uniform ). Finally, § 7 provides a lower bound on transformers, introduces the notion of an Advice Transformer, and connects these to the machine learning problems of Instruction Learning and Following.
Implications of Our Findings
Before diving into technical details, we discuss the general implications of our findings on the abilities and limitations of transformers. We will focus here on our main result (Thm. 2), which shows that log-precision transformers are in the complexity class logspace-uniform .
One interpretation of complexity classes such as , , and is sets of poly-time solvable problems that are parallelizable to a very high degree—they can be solved in parallel in constant time with enough parallel processors. This gives some intuitive explanation of our result: log-precision transformers end up in because they were designed to be highly parallelizable. Since parallelism is an important property of today’s dominant paradigm of training models at massive scale, this points to the conclusion that any massively scaled up model—transformer or otherwise—will likely obey restrictions similar to the ones derived here for log-precision transformers. There is thus an important tradeoff between the massive parallelizability of today’s networks and their representation power.
What Transformers Can/Cannot Compute.
Our result places log-precision transformers in the complexity class logspace-uniform . This has immediate implications on the kinds of problems such transformers can and cannot accurately solve.
Consider any problem that is complete for a complexity class that contains logspace-uniform . By definition of completeness, every problem log-precision transformers can solve perfectly is efficiently reducible to and is thus no harder than . This implies that—despite their massive size—the computation performed by such transformers is, for instance, no harder than solving basic -complete problems like graph connectivity: the problem of checking whether there is a path between two nodes in an undirected graph (Lewis and Papadimitriou, 1982; Reingold, 2008).
By the same token, if is strictly larger than logspace-uniform , then such transformers cannot perfectly solve . Thus, log-precision transformers cannot perfectly solve the following reasoning problems:
Linear equalities: find s.t. Assuming logspace-uniform . Follows because these problems are -complete Greenlaw et al. (1991).
Universal context-free recognitionTakes both a grammar and a string as input and return whether the grammar generates the string. Jones and Laaser (1976) demonstrate -completeness.
Propositional satisfiability (SAT)Assuming logspace-uniform . Follows because SAT is -complete (cf. Biere et al., 2009).
Horn-clause satisfiability (HORN-SAT)
Permanent computationAssuming logspace-uniform . Follows because permanent is -complete (Valiant, 1979). Allender (1999) shows permanent is not in logtime-uniform .
This highlights the limits of practical transformers with limited-precision arithmetic, indicating that they are far from being universal or all-powerful as suggested by some prior studies.
One important caveat about these negative results is that they are asymptotic in nature—they apply for “large enough” input size . It’s possible for log-precision transformers to solve such problems easily when is small. Further, these negative results are about exact solutions, but they often also extend beyond this when formal hardness-of-approximation results are known.
Limitations of Our Formal Model.
Our formal model is based on a binary classification view of transformers. However, our results apply directly to multi-class classification as well and can be extended to generation problems by viewing, for instance, next word prediction in NLP as a multi-class classification problem. However, if the transformer decoder is allowed to condition on its previous output in a generation problem, then this would violate our formal setup.
1 Potential Applications
Elhage et al. (2021) propose extracting circuitsTheir sense of “circuit” is not exactly the formal sense we use in this paper, though the goal of capturing transformers’ implicit computational mechanism is the same. that capture the computational structure of transformers. Our results suggest threshold circuit families are a good formalism for expressing mechanisms extracted from transformers. Constructively converting transformers to threshold circuits is beyond the scope of the current paper, although we hope to explore this in more detail in future work.
Testing Separation Candidates in Complexity Theory.
Thm. 2 also motivates a paradigm for quickly testing complexity theory conjectures. If a problem is believed to separate and , a transformer can be trained on problem instances. If the transformer generalizes perfectly to harder instances than it was trained on, this gives an empirical hint that the problem is in , providing evidence against the conjecture.
Circuit Computation
Let be the set of finite binary strings. For , let be its length. We refer to a function from to as a boolean function. Boolean functions can implement arithmetic operations if we define a semantics for binary strings as numbers. We will treat the intermediate values in a transformer as binary strings, and the internal operations as boolean functions.
Circuits are a model of computation for computing boolean functions of fixed-length binary strings.For a mini-tutorial on circuit complexity theory and its relevance to transformers, see Merrill et al. (2022). Formally, a circuit is a directed acyclic computation graph. The leaf nodes represent binary variables and their negations. The internal nodes represent functions in some set , and the directed edges represent the flow of function outputs into inputs of other functions. One or more nodes in the circuit are marked such that their value is the output of the circuit.
For a set of functions , a -circuit is a directed acyclic computation graph where the internal nodes have labels from .
The size of a circuit is the total number of gates in it, including negation. The depth of a circuit is the length of the longest path from any input node to any output node.
Circuit Families.
A circuit family recognizes if, for all , if and only if .
We now define classes of languages by constraining the complexity of the circuit families needed to recognize them:
Let non-uniform be the set of such that is recognizable by a poly-size, constant-depth -circuit family.
The gates , , and are all just special cases of thresholds, so we can imagine circuits to have access to these as well. Thus, circuits can implement circuits.
Circuit Serialization.
We identify a circuit with its serialization in a formal language that identifies each node’s label and adjacency list. We will adopt a specific grammar for concreteness, but our construction can be adapted to other string representations of circuits.
We define a circuit serialization as a traversal of a circuit ordered by some topological sort. In this serialization, leaf nodes (variables) are represented by the string X. An internal node (gate) is represented in Polish notation by the function it computes (AND, OR, or NOT) followed by a list of pointers to its arguments. Each argument of gate encodes (in a unary) a zero-indexed pointer to the -th gate in the circuit, where . The final node is interpreted as the circuit output.
By convention (cf. § 3), negations in circuits are usually taken to occur at the beginning of the circuit, rather than after or nodes.We can apply De Morgan’s laws to force any circuit to have this property. Our serialization grammar does not enforce this property, but of course any circuit with this property can be serialized by our grammar.
It is a bit more complicated to serialize threshold circuits. Formally, a threshold circuit serialization is generated by the following grammar:
We say a threshold circuit serialization is in prefix form if all inputs (X) come before all threshold gates (<= or >=), as is the case in this example.
Uniformity.
The circuit families we have defined above are non-uniform, meaning that we do not enforce that the circuits processing different input sizes must be related in any way. In degenerate cases, non-uniform circuit families can solve undecidable problemsConsider the unary language such that Turing machine (under some arbitrary enumeration) halts. This problem is in non-uniform since we can hard-code the right answer for each in . because they have infinite description length, making them a physically unrealizable model of computation. Complexity theorists have thus introduced uniform circuit families. Uniform circuit families are a realizable model of computation with relations to classes in computational complexity and formal language theory.
Intuitively, in a uniform circuit family, the circuits for different input sizes must be “somewhat similar” to each other. We formalize this (cf. Arora and Barak, 2009) by saying that there exists a resource-constrained Turing machine that maps the input to a serialization of circuit .
A language is -space uniformly computable by a circuit model iff there exists a Turing machine that, for all , uses space to map to an -circuit recognizing on inputs of size .
This notion of uniformity is more general than the standard notion in that the input size is a function of the problem complexity . The reason for this is that we will apply uniformity to subcomputations with different input sizes within a larger computation of input size . The standard notion of uniformity corresponds to .
Bounded-Precision Transformers
A transformer (Vaswani et al., 2017) is a neural network architecture made up of a constant number of transformer layers. A transformer layer is a module that computes self-attention over a sequence followed by an elementwise transformation of the output vectors.
We will assume that each transformer is resource bounded in terms of the precision of each value it computes and, for some of our results, the space it uses for the computation of key operations such as embedding, attention, and activation. Specifically, we will assume precision , i.e., the values at all layers, as well as the outputs of all key intermediate operations in it (attention, activation, arithmetic operators, etc.), are represented using bits. This is a realistic assumption as, in practice, today’s transformers are typically limited to the 64-bit precision of the underlying hardware. Formally, we define -precision as follows:
A -ary function is -precision if have size at most bits, and can be computed by a -space-bounded Turing machine.
This says the size of the function input and output are bounded below . Similarly, the intermediate space used by the computation must also be bounded below . Thus, higher precision computations cannot somehow be hidden inside .
Def. 6 naturally applies to functions with bounded arity . We will also need to define precision for the summation operator in the transformer, which adds different floats of size .Our proof also goes through if the transformer weights are integers, as is sometimes done (Dettmers et al., 2022). Adding floats can blow up the precision needed to represent their sum. For example, imagine adding the floating points . We obtain , whose mantissa takes bits to represent. In practice, computers do not preserve full precision in such situations: instead, small terms like are discarded. Thus, we define the transformer’s addition operation to be similarly approximate (and thus preserve precision); see § A.
2 Transformer Definition
3 Attention Heads
The core building block of a transformer is an attention head. We define this at a high level of abstraction as follows:
A -precision attention head is specified by a binary -precision similarity function .
Let be the input sequence to a -precision attention head, and let be approximate floating-point addition (§ A).
4 Transformer Layers
A -precision transformer layer is then a tuple of heads and a function used to combine them.
5 Transformer Encoder
Finally, we define a transformer of depth as a cascade of transformer layers:
For a position embedding function and , let be the position-wise broadcasted embedding of : for , .
A transformer computes the following function of a string :
We will use to denote the length of , and take the transformer’s depth to be fixed w.r.t. .
Log-Precision Transformers as Non-Uniform Threshold Circuits
We first show that log-precision transformers can be simulated by non-uniform threshold circuits, before presenting the more technical uniform version of the results in §6. The initial non-uniform result extends the findings of Merrill et al. (2022), who showed that saturated attention transformersSaturated attention is uniform attention over a subset of the prior layer nodes. can be simulated in . Here, we remove the simplifying saturated attention assumption and other restrictions on the underlying datatype. Instead, we show that our log-precision assumption is enough to prove that a transformer can be simulated in with any attention function.
Like Hao et al. (2022), we construct a circuit using a DNF representation of on inputs of size , except we use a combined DNF representation for all output bits of . The DNF formula has at most terms. The circuit has a NOT gate for each input bit, an AND gate for each DNF term, and, for each of the output bits, an OR gate combining the outputs of those AND gates (i.e., DNF terms) for which that bit is . ∎
We now use Lem. 1 to prove the following non-uniform result. We note that the proof goes through even if the notion of -precision (Def. 6) is relaxed to not require computability in space . This requirement will, however, become important for our subsequent result in § 6.
Any -precision depth- transformer operating on inputs in can be simulated by a threshold circuit family of depth .
Let be the input of a -precision transformer. We show by induction that we can construct a composition of constant-depth, poly-size threshold circuits to compute each layer of this transformer. Thus, any constant-depth transformer will be computable by a constant-depth threshold circuit.
In the base case of layer and token , we construct gates representing the constant encoded in binary. We can then compute using Lem. 1, yielding a poly-size depth-3 circuit.
Aggregating the circuit over all layers, the overall circuit depth is . ∎
Any log-precision transformer can be simulated by a non-uniform circuit family.Here, a circuit family is a constant-depth, poly-size circuit family computing some function . While we define for decision problems in Def. 4, it is standard and well-defined to extend the same term to refer to circuit families computing functions as well (Hesse, 2001).
Log-Precision Transformers as Uniform Threshold Circuits
We first extend Lem. 1 to respect uniformity:
We give the proof in the form of an algorithm to construct a circuit as a function of and then justify its correctness and space complexity.
Algorithm. We first print nodes representing unnegated and negated input nodes.We ignore the initial unnegated input nodes when considering the size of the circuit.
Now, we need to show how to construct nodes corresponding to DNF terms. To this end, we loop over all possible inputs by maintaining the bit binary representation of (initialized with ) and incrementing it by at each step of the loop. We create a new node with arguments, defined as follows. For , we create an argument pointer to (unnegated) node if and to (negated) node otherwise.
Correctness. We show that this Turing machine maps input to a serialized circuit computing on inputs of size . The first layer simply produces unnegated and negated input values. The second layer then produce all possible DNF terms. Finally, node of the third layer computes the disjunction over all terms such that . Thus, node of the third layer computes .
Thus, uses space to map to a circuit of size at most and depth that computes on size inputs. ∎
We can leverage this lemma to derive the uniform analog of Thm. 1, as follows.
Any -precision depth- transformer operating on inputs in can be simulated by a logspace-uniform threshold circuit family of depth .
In the base case, we use log space to track a counter maintaining the current token (between and ) throughout the circuit construction. We construct gates encoding the constant in binary. We can then apply Lem. 2 to construct a Turing machine that maps to a constant-depth threshold circuit computing .
Because the depth derived in Thm. 2 is constant with respect to , it follows that:
Any log-precision transformer can be simulated by a uniform circuit family.
Lower Bounds for Instruction Following and Advice Transformers
So far, we have shown that uniform is an upper bound for log-precision transformers. Is this upper bound tight, i.e., also a lower bound? While we do not answer this question here, we address a related question as a first step: we construct a transformer that can evaluate circuits on binary inputs, showing that transformers can compute any function when their input is augmented with the right “instructions”.
More formally, we consider the Circuit Value Problem (CVP) (Ladner, 1975), also referred to as the Circuit Evaluation Problem, where the input is a boolean circuit and a string , and the task is to return the value of . This problem is known to be complete for the class under reductions (Ladner, 1975). We will assume is serialized as described in § 3 and prove that log-precision transformers can evaluate any circuit. Note that this is an extension of the typical CVP since the circuit has threshold gates, not just standard AND/OR gates.
It is known that LSTMs cannot evaluate boolean formulae (Merrill, 2020), a special case of the CVP. In contrast, we show that transformers can.
To demonstrate the practicality of our lower bound construction, we will not just prove the existence of transformers that can evaluate circuits but also specify concrete choices for the positional embedding scheme and the class of attention functions that are sufficient to do so.
Saturated Attention.
After normalization, saturated attention creates a distribution that is uniform over a subset of positions. Thus, it is capable of parameterizing hard attention, uniform attention over the full sequence, and various attention patterns in between.
Simple Pooling Functions.
For simplicity, we assume pooling functions are thresholded linear functions of their inputs. Thus, they could be implemented by a feedforward neural net. Without loss of generality, we let attention heads have a value function, which can be folded into the pooling function from the last layer (see § 4).
Terminology.
We are now ready to present the main result. Our construction below is specific to circuits serialized in prefix form (see §3), but it can be extended to other serializations as well.
For all , there exists a transformer with fractional positional embeddings, saturated attention, thresholded linear pooling functions, and depth that, for any threshold circuit of depth serialized in prefix form, maps input to the value .
Base Case: Input Nodes. We use an attention layer to attend uniformly over all positions with value returns if and otherwise. This head computes , where is the number of occurrences of X in . A second layer, then, at input node , computes the positional embedding of the token representing input value :
We attend to this position to retrieve . After these layers, each input node stores its value .
We also use the base-case layers to construct an attention head that, at the -th node, counts the fraction of tokens (out of ) that are nodes to the left of the current node. Thus, the column corresponding to node stores the value .
At each gate node , we use two more attention heads to find the index of the next & to the right and then count the fraction of tokens before it that are 1. This head thus computes where is the threshold value of gate and is its arity.
Finally, using the first attention layer, we have each 1 node attend to the first argument symbol & to its left and retrieve its index . Then, in the second attention layer, each argument attends uniformly over all nodes with values . The net effect is for each argument to store , i.e., the pointer it is encoding in unary as &1j.
In the first attention layer, each argument token attends to the closest gate node to its left, which is the gate it belongs to. Recall from the base case that argument token & already stores , where is the pointer value it encodes. Each argument token now attends with query to retrieve from node its already computed value.
The second attention layer applies at gate nodes, not arguments. At gate of arity , we set the attention to indicate whether argument belongs to gate node , which holds for exactly arguments. We set the attention value at argument to be the binary value of node , which was retrieved in the previous paragraph. Thus, the attention head computes , where is the number of arguments of node that are . We repeat this for all gate nodes.
Depth- transformers can solve CVP for depth- circuits.
1 Instruction Following
CVP is closely related to instruction learning (Brown et al., 2020) and instruction following tasks (Finlayson et al., 2022). The latter task setup provides a transformer two inputs: a regular expression as an “instruction”, and . The goal of the task is to return whether belongs to the regular language represented by . Viewed from this lens, the circuit evaluation setup asks: Can transformers follow instructions provided in the form of a circuit? As discussed below, our result says the answer is yes for all constant depth threshold circuits. This, to the best of our knowledge, provides the first non-trivial lower bound for transformers in the instruction learning setting.
Formally, an instruction is any descriptionFormally, a function description is a fixed-size program to compute that function under some model of computation. of a function of . We say a transformer correctly follows an instruction if, for all , it correctly computes on input . A non-uniform instruction description is a family of length-specific descriptions . We say a transformer correctly follows a non-uniform instruction family if, for all and all , it correctly computes on input . The non-uniform description may take any form. When it forms a circuit family, we refer to it as a instruction description. Since Thm. 3 constructs a transformer that can evaluate any circuit, it follows that:
There exists a depth- transformer that can correctly follow any depth- instruction description.
Thus, transformers with simple position embeddings, attention, and pooling functions can simulate any instruction provided in the form of a circuit. We note that while it is unknown whether the class of regular languages, considered by Finlayson et al. (2022), is contained in , the other side is known: there are problems computable by circuits that are not computable by a regular language. These include problems involving counting and arithmetic, which are beyond regular languages. Our results thus expand the known kinds of instructions transformers are able to follow, at least with hand-constructed weights.
2 Advice Transformers
We can also view circuit evaluation abilities of transformers (Lem. 3) from the lens of advice taking Turing machines which, in addition to their usual input, are also provided an input length dependent (but input independent) advice string. For instance, is the class of problems decidable in polynomial time when the Turing machine is given an advice string of size polynomial in the input length (cf. Arora and Barak, 2009).
Non-uniform .
Since non-uniform even contains some undecidable languages (Arora and Barak, 2009, Claim 6.8), is clearly a very powerful class and a strict superset of , the class of decision problems recognized by transformers (which are all decidable). Thus, a problem in cannot always be solved by a transformer on its own. However, if given a description of how to do so (“advice”) in the form of a circuit, our result shows that a transformer could solve that problem.
Conclusion
Answering two open questions from Merrill et al. (2022), we prove log-precision transformers with any (including soft) attention can be simulated by uniform constant-depth threshold circuits. This establishes thresholded addition as a fundamental operation for understanding the computational model of transformers: any log-precision transformer can be re-expressed as a polynomial number of threshold gates stacked to a constant depth. This result also establishes potential limits on the computational power of log-precision transformers; e.g., if , transformers cannot compute all poly-time functions. They are certainly very far from being universal. The intuition at the heart of this result is that forcing a model to be highly parallelizable likely sacrifices its expressiveness. Since parallelism seems essential to pretraining any massive model at scale, any large language model—transformer or otherwise—may suffer from a similar tradeoff.
Acknowledgments
The authors are grateful for the valuable feedback from the anonymous reviewers and the TACL action editor Dan Gildea. They also thank Paul Beame and colleagues at AI2 including Kyle Richardson, Michal Guerquin, Peter Clark, Tushar Khot, and especially Matthew Finlayson, whose empirical findings about instruction learning inspired § 7. Feedback from Sam Bowman, Arya McCarthy, Roma Patel, and Lena Strobl, and discussions with the FLaNN, ML for Code (MILA), and Foundations of Language Processing (Umeå) research groups helped improve earlier drafts. The authors also appreciate Rahul Santhanam’s feedback. This work was funded in part by NSF award 1922658. William Merrill was supported by an NSF graduate research fellowship and by AI2.
References
Appendix A Iterated p𝑝p-Precision Float Addition
We interpret a -bit string as a -precision float by taking the first bitsWe assume w.l.o.g. that is even. of as a signed integer encoding the mantissa and the remaining bits of as another signed integer encoding the exponent. A float with mantissa and exponent , denoted , encodes .
We define float addition by mapping the floats to integers, adding the integers exactly, and then mapping the sum back to a float (with possible loss of precision). Let be the greatest -bit signed integer, and . Let be the greatest value representable by a -precision float. Since the exponent of a float can be negative and represent a fraction, we rescale by when mapping it to an integer :
The integer mapping of a -bit float is defined as .
when ; otherwise (i.e., when ), we set to properly handle overflow.
We define the sum of -precision floats as
We first verify that Def. 14 closely approximates exact addition.
Let be a float such that and . Then and differ by a factor of at most .
Let , which is well-defined because of the precondition of the lemma. Let .
Recall that the value of is . By the above argument, we also have that the value of is within , which is within . Thus, and are within a factor of of each other. ∎
Finally, we show that, with log precision, computing (Def. 14) is in uniform .