Learn to Solve Algebra Word Problems Using Quadratic Programming
Paper · 2015 · Lipu Zhou, Shuaixiang Dai and Liwei Chen
Summary
Solving an algebra word problem begins with deciding what equations the words describe. In the paper’s example about amusement park tickets, the prices for children and adults belong beside the unknown ticket counts in a revenue equation. The number of people admitted belongs in a separate equation for total attendance. Lipu Zhou, Shuaixiang Dai and Liwei Chen build a solver that learns to make these choices from examples. It takes equation patterns from training problems, tries placing the numbers from a new problem into those patterns, and ranks the resulting candidates. The highest-ranked candidate supplies the numerical answer.
An earlier solver by Kushman and colleagues also reused equation templates. It searched for assignments of nouns to unknowns as well as assignments of numbers to numerical slots. Zhou and colleagues keep the unknowns in each template and search only over the numerical assignments. To recover some of the information that noun assignments supplied, they check which nouns are connected to a number and whether those nouns recur in the question. Other features examine comparative wording, the relationship between pairs of numbers, and properties of the calculated answer, such as whether it is positive or integral. The paper reports 1.9K possible alignments per problem for its solver, compared with 4M for the earlier solver. This makes it practical to score every candidate at prediction time.
Training uses a maximum-margin objective. The authors want a correct candidate to score above an incorrect one by a margin, with a penalty for falling short. The resulting quadratic program has more potential constraints than the training procedure needs to handle at once. It starts with a sample of incorrect candidates and adds constraints as it finds candidates the current scorer handles poorly. In 5-fold cross-validation on the benchmark introduced by Kushman and colleagues, the new solver reaches 79.7% answer accuracy with training equations and answers, and 72.3% with training answers and a supplied template collection whose entries are unpaired with the problems. The earlier fully supervised solver reaches 68.7%. Removing any of the new solver’s feature groups lowers its fully supervised accuracy.
The results show how far a solver can get by reusing equation structures, searching their numerical assignments exhaustively, and learning which assignments the wording supports. The authors’ error examples also show what that strategy asks of its features. An unfamiliar verb can hide the fact that a quantity should be subtracted, and a single noun can give an incomplete account of an entity described by a longer phrase. Both errors can arise even when the relevant arithmetic is within reach.
Deep dive: Learn to Solve Algebra Word Problems Using Quadratic Programming
This paper learns to solve algebra word problems by filling equation templates with numbers from the text and ranking them with quadratic programming. · about 39 minutes to read
The problem and its context
Turning a description into equations
An algebra word problem gives quantities in prose and asks for quantities that must be inferred. The step that interests the authors comes before ordinary equation solving. The solver has to decide what each number measures, how those measurements are related, and which unknowns the question asks it to recover. Once a suitable system is written down, its numerical solution can be calculated. The same calculation applied to an unsuitable system can produce a perfectly definite answer to a different problem.
Consider the amusement park example that the authors use to introduce their method. The story gives ticket prices of 1.50 for a child and 4 for an adult, says that 278 people entered, and reports 792 in admission revenue. The two questions ask for the corresponding attendance counts. Both counts contribute directly to total attendance. They also contribute to revenue, after each is multiplied by the appropriate price. The interpretation has to carry the same unknown from the attendance relation into the revenue relation. It also has to distinguish the reported totals from the numbers that act as rates.
The story mentions 2 as the number of ticket categories. That number helps a reader understand why there are separate counts for children and adults. Its role differs from the roles of the prices and totals. The equation representation therefore needs a way to use a subset of the available numbers. A procedure that simply collects every numerical mention and treats each as a coefficient or a constant would have to find an algebraic role for a number whose job in the story is to describe its structure.
This is a problem in semantic parsing. Here the target representation is an equation system whose interpretation can be checked by solving it and comparing the result with the expected answer. It is also a form of question answering. The question can repeat an entity introduced earlier, and those repetitions help identify which quantities in the description bear on the requested answer. The paper makes this connection operational by giving the question’s wording a role in ranking assignments.
The distinction between a number and its role also matters in stories with similar vocabulary. A number could describe a unit price, the amount paid in all, a difference between quantities, or a multiplier expressing how one quantity relates to another. The role determines where it belongs in the equation. Its position and the words nearby offer clues. The rest of the story offers others. For example, quantities described in parallel phrases may fill parallel positions, while a comparison can make the order of the quantities decisive.
From hand-written rules to learned templates
The authors place the task in a line of work that goes back to Bobrow’s study of natural-language input for a problem-solving system. They describe rule-based approaches as the traditional way of building word-problem solvers. Rules supply interpretations of recurring constructions and can state explicitly how a recognized construction maps into a formal representation. The paper places its historical starting point with Bobrow’s natural-language problem-solving work.
The paper also identifies a move towards machine learning. Its rationale is that problems built around the same mathematical relationship tend to share aspects of wording and sentence structure. An example that specifies what each member of a group contributes and then gives a total can resemble another such example even when the entities and numbers change. Training examples can consequently provide evidence both about which equation structures recur and about which textual details predict a numerical role.
The immediate predecessor is Kushman and colleagues’ 2014 solver. It abstracts templates from training equations and fills slots in those templates for a new problem. The template distinguishes positions for numbers from positions for unknowns. To instantiate it, the earlier method considers assigning textual nouns to the unknown positions and textual numbers to the number positions. A proposed interpretation thus makes commitments about both the numerical structure and the entity correspondence.
While keeping the collection of equation structures intact, Zhou and colleagues redefine what counts as an assignment. Their candidates contain an equation template and a placement of numerical mentions. The unknowns remain in the algebraic structure and tie its equations together. The connection between these unknowns and the wording enters through features that score the numerical placement. A noun close to a price, for example, can support the assignment of that price to a role associated with a question about the same entity. The scorer can use such evidence without enumerating an explicit noun assignment for every unknown position.
The reduction matters because the alternatives multiply. A template may have several numerical roles, and a problem can contain more numbers than the template can hold. The choices include which mentions to use and which position receives each chosen mention. Doing a separate noun search introduces an additional set of possibilities for each numerical choice. Dropping that search leaves an assignment space that still grows with the number of available mentions and slots. It is a smaller space because each candidate makes fewer explicit choices.
A ranking problem at training time
The second change concerns how the solver learns to prefer a correct derivation, the paper’s term for an instantiated candidate together with its solution. The authors describe maximizing the likelihood of observed examples as a common approach to learning this kind of scoring function. They cite earlier work on learning mappings into logical forms as well as Kushman’s algebra solver. One of those antecedents is Inducing Probabilistic CCG Grammars from Logical Form with Higher-Order Unification.
With a normalized probability over candidates, evaluating the likelihood gradient requires contributions from a large hypothesis space. The paper describes Kushman’s use of beam search to approximate this calculation. A beam keeps a limited set of promising possibilities during search. The approximation lets training proceed at the cost of using only part of the available evidence. Which candidates the beam retains can affect what the learner sees.
The authors instead frame learning as a set of comparisons. For a given word problem, they ask how much a correct derivation outscores an incorrect one. This comparison uses the same underlying feature-based scores as the probabilistic formulation. The shared normalization cancels when the log probabilities are subtracted. Training can therefore focus on individual correct–incorrect comparisons and add selected comparisons to the optimization as needed. That choice and the smaller assignment space address different parts of the work. The smaller space makes candidates easier to enumerate, and the margin objective changes which computations need to be performed to fit the weights.
The method, step by step
Collect templates and enumerate numerical assignments
The method begins with training problems and the equation patterns that can be abstracted from them. A template preserves the equations’ algebraic structure while replacing numerical values with slots. A slot has a position and a function inside that structure. A coefficient that multiplies an unknown has a different function from a total on the other side of an equality. Two equations can refer to the same unknown because that identity is already part of the template. The authors follow Kushman’s approach to abstracting templates and report automatically merging equivalent equation-system templates for the experiments.
For each new problem, the solver considers templates whose numerical slots can be filled from the available numbers. For any one template, it picks an ordered sequence of numerical mentions without reusing a selected item. The order matters because the sequence fills the template’s ordered slots. Choosing the same mentions in another order can put a rate in a total position or swap rates that apply to different unknowns. A mention outside the selected sequence remains outside that candidate equation system.
In the amusement park example, a template can express the structure of a count equation alongside a revenue equation. The count equation adds the two unknown attendance counts and equates their sum with 278. The revenue equation multiplies the children’s count by 1.50 and the adults’ count by 4, adds those products, and equates the result with 792. These assignments keep the units consistent with the story. The number 2 can remain unused as a numerical input to the template because the separate unknowns already express the category distinction.
That example also shows why a candidate needs more than a template identifier. The same template can hold a correct assignment and a range of incorrect assignments. A search that chose the right template would still have to put each number in the right place. Conversely, a good match between a particular number and a particular slot does little for the final answer if other slots are wrong or the template expresses a different relationship. The complete candidate is the unit that receives a score.
How the solver goes from examples to answers
The steps in order.
The paper formalizes this process with a collection X of training problems and a template inventory T. The symbol xᵢ denotes the problem indexed by i in X. The symbol Tⱼ denotes the template indexed by j in T. For a particular template, N(Tⱼ) denotes its collection of numerical slots, and m gives the number of slots. For the problem, N(xᵢ) denotes the collection of available numbers, and ℓ gives the number available. The stated condition for forming assignments to that template is that ℓ be at least m.
An assignment sequence, written πᵢⱼₖ, contains m selected numbers from N(xᵢ) in slot-filling order. The index k identifies an assignment for the problem and template. Filling Tⱼ with that sequence produces eᵢⱼₖ, an equation system, and solving it gives sᵢⱼₖ. The full object is written as follows.
yᵢⱼₖ = (Tⱼ, πᵢⱼₖ, eᵢⱼₖ, sᵢⱼₖ)
Here yᵢⱼₖ is the derivation, with i identifying the word problem, j the template and k the particular assignment. The four entries record the template Tⱼ, the ordered placement πᵢⱼₖ, the resulting equations eᵢⱼₖ and the solution sᵢⱼₖ. The parentheses group entries that belong to the same candidate. The equality defines the representation. The set Yᵢ gathers the possible derivations for xᵢ across the template inventory. Prediction amounts to selecting an element of Yᵢ and returning the solution it contains.
Keeping the solved answer in the candidate serves two purposes. The solution is the output evaluated in the experiments. It also gives the scorer evidence about plausibility before the final candidate is selected. A number assignment can therefore be judged from the words surrounding its inputs and from the numerical character of its result. This requires the candidate equations to be instantiated and solved before their solution features can be computed.
Describe a number in its proposed role
For each problem and derivation, the solver builds a feature vector. Each entry describes an observable property or relationship that might help distinguish correct candidates. The feature can be an indicator, such as whether a number occurs in the question sentence, or a graded value, such as how closely a number is associated with a noun in that question. The learned weight says how much that entry contributes when scoring a candidate.
Most of the features carry a signature that associates them with an algebraic role. Single-slot features are generally tied to a specific numerical slot, pair features to particular slots considered together, and solution features to the equation template. This lets the same observation have different effects in different parts of an equation. Seeing language associated with a rate can help a candidate when the number occupies a rate slot. The observation acquires its predictive meaning from the place the candidate assigns to that number.
The first feature group examines one numerical assignment at a time. For a number in a sentence, the solver gathers the nouns from that sentence and orders them by the lengths of their syntactic paths to the number. A path follows links between words in the sentence analysis, so its length reflects grammatical connections rather than a count of the intervening words in the printed sentence. The paper obtains its sentence analyses through The Stanford CoreNLP Natural Language Processing Toolkit. The feature uses the structure obtained by dependency parsing.
The solver then looks for the earliest noun in the resulting list that also occurs in the question sentence. It takes the reciprocal of that noun’s rank. An early match produces a stronger signal, and the strongest case receives a separate indicator. There is also an indicator for a number that appears within the question sentence itself. The graded feature can be expressed in the paper’s terms as follows.
q = 1/n
Here q denotes the strength of the number’s link to the queried entity, and n is the rank of the first noun in the number’s sorted noun list that also occurs in the question sentence. The slash denotes division, and 1 is the numerator in the reciprocal. A rank of 1 gives the largest possible value. The paper describes the calculation for a noun match, leaving the value for an absent match implicit.
For the children’s ticket price, the paper gives the list in this order: the currency symbol, the noun for tickets, and the noun for children. The price is written as 1.5 in this feature example. The word for children occurs in the question about their attendance and has rank three in the list, so the feature is 1/3. The path-based ranking makes this match usable even though other items are syntactically closer to the price. A binary test for the top-ranked noun would lose that evidence.
The feature provides an indirect connection between a number and an unknown quantity. It supplies evidence that the children’s ticket price concerns the group asked about in the question. The candidate template determines how the assigned price participates in a particular equation. Linking the feature to the slot lets the scorer learn that a relationship between the wording of a question and the context of a number is useful for some placements. The grammatical link and the equation role remain separate pieces of evidence.
Another single-slot feature records comparative wording and where the number lies in relation to it. The paper illustrates the issue with 3 and a quantity described as twice another. Saying that one quantity is below twice another by 3 expresses a different equation from placing it above that amount by 3. The first relationship can also be expressed by reversing the direction of the comparison and describing the doubled quantity as the larger one. The comparative word and the surrounding arrangement jointly matter. A feature built from the comparative word alone would treat these uses as though its algebraic contribution were fixed.
The solver also takes information from a window of [-5, +5] around the number. The observations include the base forms of words, their grammatical categories and the types of syntactic link associated with them. Base forms bring together inflected versions of a word under a lemma. The grammatical categories come from part-of-speech tagging. The surrounding dependency types can distinguish uses of similar words in different grammatical relationships. Taken together, these observations give the scorer several ways to recognize a number’s context.
If the number’s part-of-speech tag or entity tag marks it as something more specific than a general number, the solver also uses those tags together with the first associated noun and the dependency type connected to the number. The tagging evidence concerns how the number is presented in the sentence. It can complement its value: a numerical mention can function as a measurement or other marked entity in context. The paper’s use of entity tags draws on named entity recognition.
Some features describe the numerical mention more directly. The authors flag 1 and 2 because such values can specify how many variables the text is talking about. The ticket example’s statement about 2 categories illustrates the broader distinction between a structural count and a numerical input to an equation. This particular feature carries no slot signature, reflecting the paper’s observation that these uses recur across different kinds of problem. The solver also flags numbers in the open interval (0, 1) and expressions that indicate multiplication, such as “twice” and “triple.” The interval excludes its endpoints and distinguishes fractional values within that range.
Describe how two numerical assignments fit together
The second feature group asks whether two numbers make sense in their proposed roles together. A number can seem plausible for a slot when inspected alone. Another assigned number can reveal that the candidate mixes quantities with different textual roles. In a template with parallel slots, the scorer may have reason to expect parallel descriptions. In a template where a slot stands for a total and others for its parts, relative numerical size can carry information. Pair features give the scorer access to these relationships.
One feature compares the lists of nouns associated with the two numbers. A common noun is stronger evidence when it appears near the top of both lists. The solver considers equal nouns across the lists and takes the largest reciprocal score from their combined ranks.
r(n₁, n₂) = max { 2/(ord₁(a) + ord₂(b)) : a ∈ NP₁, b ∈ NP₂, a = b }
Here n₁ and n₂ are the two numbers, while NP₁ and NP₂ are their respective lists of associated nouns. The symbols a and b denote nouns examined in the first and second lists. The sign ∈ means that a noun belongs to its list. The condition a = b restricts the calculation to matching nouns. The functions ord₁ and ord₂ return their ranks in the corresponding lists, starting at 1. The plus sign adds the ranks, and the slash divides 2 by the sum. The braces collect eligible scores, the colon introduces the eligibility conditions, and max selects the largest score. The function r gives the resulting relationship value. The displayed calculation characterizes the case with at least one common noun.
The highest possible value of r is 1, attained when the first noun in each list is the same. The paper gives this case a separate feature. In a candidate involving addition, a shared noun can provide evidence that the two quantities are comparable. The authors use the example of summands whose units should agree. A shared noun is evidence of that agreement, and the scorer learns how much the evidence is worth for a particular pair of slots. The feature is a numerical input to the ranker, so other evidence can affect the final decision.
A separate calculation compares the contexts around two numbers. This is useful when the slots are symmetric or play parallel roles in a template. In the amusement park example, the child and adult prices are introduced with comparable language and both multiply attendance counts in the revenue equation. Similar wording around the prices therefore supports their assignment to parallel positions. The same idea can apply when the exact nouns differ but the grammatical forms or dependency types are alike.
sim(ST₁, ST₂) = |ST₁ ∩ ST₂| / |ST₁ ∪ ST₂|
In this formula, ST₁ and ST₂ denote sets of context tags around the respective numbers. The function sim gives their similarity. The intersection sign ∩ collects tags found in both sets, and the union sign ∪ collects tags present in either set. Vertical bars give the number of distinct elements in the enclosed set. The slash divides the common-tag count by the overall distinct-tag count. The paper uses lemmas, part-of-speech tags and dependency types, with a window size of 5 for this calculation.
The similarity depends on the proportion of shared tags across the two contexts. A common tag can contribute without an exact match between the sentences or the positions of all the words. Treating each context as a set means that repeated tags do not add separate elements. The feature summarizes overlap, while other features carry information about the words or syntactic connections between the two numbers.
The solver also asks whether elements in the sentences containing the numbers refer to the same thing, using coreference resolution. This signal can connect evidence across sentences and can capture links that a simple comparison of noun strings misses. The feature is triggered by coreference between elements of the sentences. Its definition supplies a broader connection than an explicit assignment of either number to a named unknown.
Other pair features record whether both numbers are multipliers, whether their sentences are the same or adjacent, and what can be observed along the surface and dependency paths between them. Comparing numerical values gives the scorer another clue. In the paper’s example, positive summands are smaller than their sum, so relative magnitude can help distinguish a proposed total from a proposed part. The mathematical relevance of the comparison depends on the template roles and conditions. The feature lets the ranker use it in context.
The different pair signals capture different kinds of agreement. A shared noun connects references. Context overlap connects descriptions. A syntactic path can reveal a local grammatical relationship, and the order of numerical values can support a particular algebraic arrangement. Sentence proximity records where the information occurs in the story. Several of these cues may apply to the same pair, and their contributions enter the candidate’s score together.
Use properties of the calculated answer
The third feature group comes from solving the candidate equation system. The paper checks whether the solution is integral, whether it is positive, and whether it falls in (0, 1). These are plausible expectations for different sorts of answers. Ticket counts give a reason to pay attention to integrality. A probability question gives a reason to pay attention to a fractional answer strictly inside the interval used by the feature. The feature signature ties these observations to the template so the scorer can learn where they help.
A plausible numerical form supplies partial evidence. Several incorrect assignments can produce positive integers, and several can produce values inside the relevant interval. A solution feature therefore works alongside text evidence about how the candidate was constructed. Its benefit is that the solver can use the consequences of an assignment, in addition to the wording that first suggested it. When two derivations look similar on their local features, the properties of their solved answers can give them different scores.
The paper uses these properties as features. Their effect comes through fitted weights rather than fixed eligibility conditions. A candidate can receive a different contribution for a property depending on the template, and the full score still reflects the single-slot and pair evidence. This design leaves the arithmetic calculation to the instantiated equation system and gives learning the job of deciding how strongly a particular numerical pattern supports the answer.
Score the derivations
The full feature vector is written φ(xᵢ, yᵢⱼₖ). It depends on the word problem and on the proposed derivation because many observations change their algebraic meaning when the assignment changes. The words near a number are a property of the text. The claim that those words surround a number proposed for a particular coefficient is a property of the text and the candidate together. A vector θ stores one weight for each feature dimension. Their dot product is the sum of the feature values weighted by the corresponding entries of θ.
The authors introduce a log-linear probability to express the relative preference among derivations for a given problem. The score becomes a positive quantity through exponentiation and is then normalized over the candidate set.
p(yᵢⱼₖ | xᵢ; θ) = exp(θ · φ(xᵢ, yᵢⱼₖ)) / ∑_{y′ ∈ Yᵢ} exp(θ · φ(xᵢ, y′))
Here p is the conditional probability of derivation yᵢⱼₖ for problem xᵢ with weights θ. The vertical bar introduces the given problem, and the semicolon separates the weight parameter from it. The index i identifies the problem, j the template and k the assignment. The function φ gives the feature vector, the centered dot is the dot product, and exp denotes the exponential function. The slash divides the candidate’s exponentiated score by the normalizing sum. The sign ∑ is summation, y′ is the candidate varied by that sum, ∈ denotes membership, and Yᵢ is the set of derivations for xᵢ. The same denominator applies to every candidate for that problem.
The denominator ties together all candidates for a problem. This matters when training uses the normalized probabilities directly. It also gives the authors a way to simplify their chosen comparison. For two candidates for the same problem, the natural logarithm turns each numerator into its original score and subtracts the logarithm of the same denominator. Taking the difference removes the common term. The comparison can be written entirely in terms of the two feature vectors.
ln p(yᶜᵢⱼₖ | xᵢ; θ) − ln p(yᶠᵢⱼₗ | xᵢ; θ) = θ · (φ(xᵢ, yᶜᵢⱼₖ) − φ(xᵢ, yᶠᵢⱼₗ))
Here ln is the natural logarithm. The superscripts c and f mark a correct and a false derivation, respectively. In this comparison, i identifies the common problem xᵢ, j is the template index in the paper’s notation, and k and l identify the compared assignments. The function p gives their conditional probabilities, with the bar and semicolon playing the same conditioning and parameter roles as in the probability formula. On the right, φ gives each candidate’s features, the minus sign inside the parentheses subtracts the false candidate’s vector, and θ is the weight vector. The dot evaluates the feature difference with those weights. The minus sign on the left gives the gap between the log probabilities.
A feature with the same value in both candidates cancels in the comparison. A feature that differs contributes in proportion to its weight. This is the form the authors use for training. The comparison can reward a placement that has stronger contextual evidence, or it can reward an answer whose numerical property supports that template. The chosen weights have to serve many such comparisons across the training problems.
Fit the weights with a margin
A positive score gap puts the correct candidate above the false candidate. The authors ask for a gap of at least 1 in the training constraints. This requirement leaves a margin between the scores and gives the optimization a way to distinguish a small preference from a stronger separation. Some comparisons can be difficult to satisfy together because the available features capture only part of the wording. Slack variables allow the solver to fall short and pay a penalty.
The paper names the difference between a correct candidate’s feature vector and a false candidate’s vector ϕ. Using that difference, its objective and constraints can be written together as a single optimization problem.
min_{θ, ξ} ½‖θ‖² + C ∑_{i,j,k,l} ξᵢⱼₖₗ subject to θ · ϕ(xᵢ, yᶜᵢⱼₖ, yᶠᵢⱼₗ) ≥ 1 − ξᵢⱼₖₗ and ξᵢⱼₖₗ ≥ 0
The operator min asks for the smallest objective over the weights θ and collection of slacks ξ. The quantity ‖θ‖² is the squared Euclidean length of the weight vector, and ½ multiplies that term. The plus sign adds the slack penalty. The coefficient C controls its weight, and ∑ adds the non-negative slacks indexed by i, j, k and l. In the constraints, xᵢ is the problem, yᶜᵢⱼₖ its correct derivation in the comparison, and yᶠᵢⱼₗ the false derivation. The function ϕ subtracts the latter’s feature vector from the former’s. The dot multiplies this difference by the learned weights. Each ≥ sign sets a lower bound, and the minus sign reduces the required unit gap by the associated slack. The bounds apply to each included comparison.
The objective balances the squared size of the weights against the amount by which the comparisons fall short. If the correct score already leads by the required margin, the corresponding slack can be zero. If the score gap is smaller, a positive slack makes the constraint feasible and contributes a cost. The coefficient C sets how heavily that cost figures in the tradeoff. The experiments use C = 0.01 throughout. Because the weight penalty is quadratic and the constraints are linear in the optimization variables, the problem has the quadratic-programming form named in the title.
The quadratic program learns the feature weights. The equations representing a word problem and the quadratic program that trains the ranker operate at different stages. The former give a numerical answer for each candidate assignment. The latter adjusts a single set of weights so the scorer can separate correct derivations from false ones across training problems. At prediction time those trained weights are already available.
Add comparisons as training needs them
For each training problem, many assignments can generate false derivations. Writing a constraint for every possible comparison from the beginning would give the optimizer a large problem. The paper uses constraint generation, an iterative approach that solves the optimization over a working collection of constraints and expands that collection in response to the current fit. The authors motivate it through the observation that only a portion of the possible constraints are active at the solution.
Training begins with a random sample. In the experiments, the authors select 300 false derivations per problem for the initial training set and use liblinear to solve the quadratic program. They then use the fitted scorer to check for further false derivations it handles incorrectly. Each constraint-generation step can add at most 300 such false derivations per problem. The added comparisons expose the next optimization to errors made by the current weights.
The choice of new negatives therefore changes as the weights change. An implausible assignment whose score is already well below the correct candidate’s gives little reason to enlarge the working set. A false candidate the scorer handles poorly can supply a more consequential comparison. Refitting after the additions can alter which candidates are troublesome on the next pass. The iterative procedure directs optimization towards comparisons that the current fit has trouble with, while the pool of candidate assignments remains defined by the templates and available numbers.
The paper describes stopping when the cross-validation error worsens, the training error converges, or a round yields no new constraints. It reports using 5-fold cross-validation to control overfitting and gives a release address for the implementation. The implementation detail that matters for interpreting the reported workload is that candidate enumeration, feature extraction and optimization over the selected comparisons are distinct activities. The size of the working set describes what reaches the quadratic program.
Supply supervision and select an answer
The authors test two ways of supplying correct training evidence. Under full supervision, each training problem comes with its equation and its correct answer. The equation identifies the algebraic structure associated with that problem, while the answer gives its numerical solution. The scorer learns against false derivations generated from candidate assignments. This supervision gives training information about the intended intermediate representation as well as the final response.
Under weak supervision, each training problem comes with its numerical answer and training has access to the template inventory. The linkage between individual problems and their templates is hidden. The solver examines derivations from the templates to find those that yield the right answer. The correct answer thus becomes the criterion for identifying useful derivations in a search that also has to recover the structural association. The template collection is supplied in both cases, and in the weakly supervised experiment it remains available even though the problem-by-problem matches are withheld.
A matching answer is an indirect form of guidance about an equation. If two assignments happened to give the same solution, the numerical answer by itself would give the same evidence for both. An equation provides an additional way to identify the intended interpretation. This is the difference in available information between the two training setups, and it matters independently of the procedure used to learn the weights.
For a new problem, the solver enumerates the derivations in its candidate set and calculates the score for each. The candidate with the greatest score also has the greatest probability under the log-linear definition, since exponentiation preserves the ordering and the normalization is shared across that problem’s candidates. Selecting the answer reduces to the following decision.
ŷᵢ = arg max_{yᵢⱼₖ ∈ Yᵢ} θ · φ(xᵢ, yᵢⱼₖ)
Here ŷᵢ is the selected derivation for problem xᵢ. The operator arg max returns a candidate attaining the largest score. The derivation yᵢⱼₖ varies over Yᵢ, with ∈ indicating membership, j indexing the template and k the assignment. The score is the dot product of learned weights θ with the features φ of the problem and candidate. The equality defines the selection, and the hat marks the chosen derivation. The numerical answer comes from the solution stored with it.
This is exhaustive inference within the candidate inventory. Every generated derivation is eligible to win, including assignments that might have been discarded early by an approximate search. Candidate coverage and scoring quality still play separate roles. Enumeration can find the best-scoring member of the inventory. An accurate answer requires a suitable member to be present and the learned score to favor it.
Experiments and results
Benchmark, supervision and accuracy
The experiments use the algebra word-problem dataset introduced by Kushman and colleagues. This makes their earlier solver a direct comparison on the same benchmark. The authors use the same parser version as the earlier work and automatically merge equivalent templates. The benchmark evaluates a pipeline that takes the wording of a problem, makes the equation and assignment choices, solves the selected candidate, and returns its numerical answer. It is an end-to-end test in evaluation and benchmarking.
The reported metric is average answer accuracy in 5-fold cross-validation. The evaluation compares the numbers in the computed answer with the reference values and disregards their ordering. For a question that asks about several quantities, the criterion therefore concerns the returned values collectively. The evaluation gives the same numerical credit when the returned values are presented in a different order. Evidence about whether each value has been assigned to the right named entity would require a criterion sensitive to that assignment.
The main comparison includes the proposed solver in both supervision settings and Kushman’s solver in its fully supervised setting. The fully supervised result for Zhou and colleagues is 79.7% average answer accuracy. When the training answers and the collection of templates are available without their individual problem–template matches, the proposed solver reaches 72.3%. Kushman’s fully supervised solver has 68.7% average answer accuracy on the benchmark.
Average 5-fold answer accuracy on the Kushman algebra word-problem benchmark
The proposed solver leads under full supervision and remains ahead of the earlier solver with answer-only problem labels and a supplied template inventory.
The numbers
| System or setting | accuracy % |
|---|---|
| Kushman and colleagues, fully supervised | 68.7 |
| Zhou and colleagues, weakly supervised | 72.3 |
| Zhou and colleagues, fully supervised (this paper) | 79.7 |
The fully supervised comparison assesses the complete change to the solver under comparable access to equations and answers. It combines the reduced assignment representation, the features, the training objective and search procedures. A difference between the systems in this comparison belongs to that combined change. The experiment does not supply a run in which the earlier solver changes only its objective or only the choice of alignment variables.
Within the new solver, the supervision comparison gives a different kind of evidence. In the weak setting, the answer has to guide the recovery of a useful derivation from known template structures. In the fully supervised setting, the associated equation is already available during training. The lower weak-supervision result shows the value of that more direct guidance in this benchmark. The weakly supervised result still exceeds the result reported for the earlier fully supervised system. Its interpretation depends on the fact that the weak setting retains the template inventory.
Answer accuracy measures the part of the task encountered by someone checking the final numbers. A solver that selects an unsuitable derivation and happens to reach the reference values can receive credit. For the proposed representation, the score that matters in deployment is the best-ranked derivation’s score relative to the other candidates. The evaluation checks the answer associated with that decision, while the derivation itself gives a representation that could be examined with a more detailed criterion.
Candidate counts and learning workload
The paper reports 4M alignments per problem for Kushman’s solver and 1.9K for the new solver. These counts describe the size of the alternatives the systems consider for an individual problem. In the earlier representation, an alignment includes choices about assigning nouns to unknowns as well as assigning numbers to slots. The new representation makes the numerical placement explicit and represents the link to the wording in its features. Its smaller candidate inventory is what makes exhaustive scoring feasible in the reported setting.
The training statistics also report 80K mean negative samples and 9K mean negative samples used in learning for the proposed method. These are the learning statistics for the pool of false candidates and the portion that reaches the optimization. They describe a different aspect of the workload from the number of alignments per problem. The working-set procedure lets the optimization proceed with a selected group of comparisons. It can examine the scorer’s performance on candidates while keeping the size of the quadratic program smaller than the full negative pool.
The counts help explain why exhaustive inference and selective training go together. At inference the solver scores the candidates for a single problem using weights that are already fixed. In training, comparisons from several problems would contribute constraints to a shared optimization, and adding constraints can require refitting the weights. A practical number of candidates to score for one problem can still yield a large pool of potential training constraints. The paper’s two changes address those two costs.
The reported mean time for feature extraction is 22m and the mean training time is 7.3m for the proposed solver, with m denoting minutes. These measurements were obtained on a laptop with an Intel i5-3210M and 4G RAM. For Kushman’s solver, the paper reports 83m for feature extraction and training together. That run used an Intel E5-2620 workstation with 128G memory because the authors found the earlier solver too memory-intensive for an ordinary laptop.
The measurements establish that the authors could run the proposed training pipeline with their laptop configuration and observed the stated times there. The earlier solver’s timing includes both stages and comes from different hardware. The paired timing observations therefore describe the reported implementations and machines. The assignment counts and negative-sample statistics give a more direct account of the changes in the candidate representation and the optimization workload.
What the ablations show
Removing one feature family at a time
The paper removes each of the three feature groups in turn in the fully supervised setting. Such an ablation asks how a solver performs when a family of observations is taken away and the remaining families supply the scoring evidence. The comparison is against the 79.7% answer accuracy of the full fully supervised solver. Without single-slot features, accuracy is 70.4%. Without pair features, it is 69.3%. Without solution features, it is 71.8%.
Fully supervised feature ablations on the Kushman algebra word-problem benchmark
The complete feature set gives the highest answer accuracy, and removing any family lowers it.
The numbers
| System or setting | accuracy % |
|---|---|
| Without slot pair features | 69.3 |
| Without single slot features | 70.4 |
| Without solution features | 71.8 |
| All feature families (this paper) | 79.7 |
Removing the single-slot group takes away direct evidence about a number in its proposed position. This includes its connection to the nouns in the question, its placement relative to comparison words, the grammatical information near it and several properties of the numerical mention itself. The pair group can still describe relationships between numbers, and the answer can still contribute solution properties. The reduced accuracy shows that the direct relationship between a textual number and a particular algebraic role carries information those other observations only partly recover.
Removing the pair group has the lowest accuracy among the ablated settings. The single-slot features can still describe each placement by itself, and the calculated answer can still contribute plausibility evidence. The removed information concerns how two placements fit together: whether their associated nouns coincide, whether the contexts resemble one another, whether the numbers are positioned near each other, and which value is larger. The result shows the value of scoring assignments jointly, since several individually plausible placements can make an incoherent combination.
Removing the solution group leaves the evidence derived from the text and from the relationships between proposed placements. The scorer loses its direct observations about the kind of answer those placements produce. The resulting decline shows that the form of the calculated answer contributes alongside the textual interpretation. In a counting problem, for example, two candidates could look plausible in their textual contexts while differing in whether the solved counts are integers. The solution features make that difference available to the scorer.
The authors interpret the three removals as evidence that all the groups help and that their contributions are of broadly comparable importance. The ordering of the ablation results tells us which removal produced the lowest accuracy in this experiment. Each accuracy reflects the remaining features working together, with much of the evidence about a derivation available through several routes. The experiments identify the contribution of a feature family within the full system. They give no separate accuracy for the reciprocal noun rank, the contextual overlap, or any other individual feature.
The group definitions help explain the possible overlap. A pair feature based on common nouns and a single-slot feature based on a question noun both use the noun lists linked to the numbers. The first uses the lists to assess agreement between two placements. The second uses one list to connect a placement with the question. Removing either group changes which relationship reaches the scorer, while leaving some of the underlying linguistic evidence represented elsewhere. The ablation results show the loss associated with the group removed under these conditions.
What the other comparisons isolate
The full and weak supervision runs vary the information used to identify correct training derivations. They show how the proposed solver performs with problem-specific equations and how it performs when known answers have to recover that association from a supplied template inventory. The three feature removals, in contrast, concern the fully supervised setting. They give direct evidence about which families help when equations are supplied and leave their individual contributions under answer-based supervision open.
The candidate counts show the size reduction associated with searching only numerical placements. They also explain a practical consequence: the authors can evaluate every derivation at inference time. The counts measure search-space size, while answer accuracy measures the quality of the resulting decisions. There is no separate accuracy ablation that restores noun-to-unknown alignment within this solver and keeps the other design choices fixed. The head-to-head result supports the combined method and the candidate counts support the claimed reduction in enumeration.
Likewise, the negative-sample statistics describe the effect of constraint generation on the comparisons sent to the optimizer. They show that learning uses a selected part of the negative pool. There is no separate accuracy result for fitting the same scorer with every negative comparison from the start. The evidence here is about the optimization workload achieved by the reported procedure. The feature ablations are the experiments that directly measure how removing particular kinds of evidence changes answer accuracy.
Limitations
Limits identified by the authors
The first limitation the authors identify is lexical generalization. Several features depend on the words encountered around a number. When a word is absent from training, the corresponding lexical feature has little basis for connecting it to an algebraic operation. Sentence structure and surrounding words can still provide clues. The error example shows a case where those other clues can be insufficient to recover the operation intended by the story.
The example is about a worker who earns 20 dollars for a day worked and loses 5 dollars for a day idle. The story reports 25 days and net earnings of 450 dollars, then asks how many days she worked. A suitable interpretation needs to treat the idle-day amount as a deduction. The authors point to the verb “forfeits” as a word their features can struggle to associate with subtraction when it is absent from the training corpus. A learner can have relevant equation templates and still fail to recognize which one the wording supports.
The limitation concerns how a linguistic cue generalizes to a new word. The numeric values identify possible inputs, and the template supplies possible mathematical relationships. The lexical feature has to connect this formulation to the correct relationship among those possibilities. The authors propose investigating continuous representations of words in place of the current lexicalized features. Their proposed direction is word embeddings. They point to earlier research including Linguistic Regularities in Continuous Space Word Representations.
The second limitation the authors identify is their treatment of entities as individual nouns. The question-link feature and the noun-overlap feature can help when a single noun is enough to identify what a numerical mention concerns. A longer noun phrase can contain the very distinction the equation needs. Two phrases can share a prominent noun while referring to different quantities. By comparing single nouns, the solver can miss the contribution of the rest of the phrase.
Their probability example concerns San Francisco playing in the next Super Bowl and the alternative that it does not play. One probability is expressed as nine times the other, and the probabilities together total 1. The question asks for the probability of playing. Much of the wording is shared by the two events, so a bare noun match offers little help in distinguishing them. The difference involves the description of an event and its negation. A system that treats the entity at the level of a single noun may have trouble keeping the two probability expressions distinct when placing the numbers.
The authors also raise two further directions for study. One is to investigate nonlinear kernels in the quadratic program. The reported scoring comparison is linear in the supplied features, so an investigation of nonlinear combinations would be a separate experiment. The other direction is to compare against approaches designed for particular kinds of mathematical word problem, including the arithmetic solver by Hosseini and colleagues. The experiments here make their principal comparison against Kushman’s template-based algebra solver.
Limits visible in the setup
The finite template inventory sets a boundary on the solver’s coverage. The assignment procedure can change the numbers that occupy slots and can choose among available templates. It cannot construct a new equation structure beyond the inventory by rearranging the slots of an existing template. If a test problem requires a structure that the inventory lacks, exhaustive scoring only ranks the available structures. The experiment measures the approach on Kushman’s benchmark and leaves coverage on substantially different collections of equation types unmeasured.
Numerical assignment has a related boundary. To form a candidate, the solver needs numbers that can be mapped into the chosen slots under its selection procedure. The ticket example demonstrates that an extraneous number can be left unused. A problem whose expression requires an intermediate quantity inferred from the text would raise a different coverage question. The reported pipeline supplies a mechanism for inserting available numerical mentions and lets templates express algebraic relationships among them. The paper does not evaluate the strategy for generating numerical inputs beyond those assignments.
The question-link mechanism is deliberately indirect. An explicit noun assignment would make a statement about which unknown represents which entity. Here the slot features support a mapping from a number’s context into an algebraic role, while the unknowns retain their positions in the template. That can be sufficient for returning the expected values. The benchmark’s order-insensitive scoring leaves entity-level binding only partly tested. A system could earn credit for the attendance values in the ticket example while failing an evaluation that required an explicit children’s count and adult count in their proper roles.
Arithmetic coincidence also limits what can be inferred from weak supervision and final-answer accuracy. Several derivations can potentially produce the same numerical answer. A matching value then gives the learner or the evaluator an ambiguous signal about how the answer was obtained. The paper reports whether the final answer matches, and the full training condition provides equations. A separate derivation-level evaluation would be needed to establish how frequently correct numerical answers correspond to the intended equations and entity assignments.
The performance of the linguistic features depends on the preprocessing used to construct them. If a dependency path orders the nouns poorly, the reciprocal-rank feature may favor the wrong connection. If an entity spans a phrase that the noun representation reduces to an uninformative head, the comparison operates over an incomplete description. The common parser version makes the comparison with Kushman’s solver easier to interpret. The reported experiments do not establish how sensitive the results are to changing the parser or to the accuracy of particular tagging and coreference decisions.
Numerical plausibility has a similar boundary in the feature design. A solution that is positive or integral can still arise from an incorrect equation, and the expectation of a value in (0, 1) depends on what the problem asks and how the quantity is expressed. The paper lets learned weights use those properties as clues tied to a template. Its evidence supports their contribution on the benchmark. The experiments give no breakdown by type of answer that would show where a particular plausibility feature works best or where it steers the scorer towards a false candidate.
Finally, the comparison bundles changes in representation, scoring features, training and inference. The feature ablations isolate contributions within the proposed solver more directly than the head-to-head comparison isolates the source of its overall advantage. The timing runs also use different machines for the two systems. The paper demonstrates the accuracy and feasibility of the complete approach under its benchmark and hardware conditions. Claims about the effects of maximum-margin training on its own or about scaling to other problem collections would require additional controlled comparisons.
What came after
Equation structure in tree-based solving
A later citing paper from 2020 takes up math word problems through a semantically aligned, tree-structured solver. Its stated focus can be read alongside the earlier paper’s decision about where to represent structure. Zhou and colleagues put the algebraic structure in a collection of equation templates and give the scorer linguistic evidence about which numbers belong in which positions. The later paper puts tree structure and semantic alignment at the center of its solver’s description. In both cases, a structured output gives the solver something more specific to recover than a bare numerical answer. The citing work is Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems.
The connection that can be established is at the level of the problem and the representation. The earlier solver asks which existing equation structure can accommodate the numbers in a way supported by the text. A tree-structured formulation describes the organization of the mathematical output in a different form, with semantic alignment explicitly named as part of the solving task. The citation places the earlier paper in the work that the later solver draws on. It does not establish that the later solver reused the numerical-slot search, the feature design or the quadratic objective.
Numerical reasoning with geometry questions
A citing paper from 2021 extends the setting represented by these works to geometric question answering and multimodal numerical reasoning. The earlier experiment begins with a written story and gets its assignment evidence from the wording, the numbers and the relations that candidate equations imply. GeoQA identifies geometry and multiple input modalities as part of the benchmark problem. The connection is the need to recover a mathematical relationship from the information a question presents. The later benchmark places that question in the setting of Vision and language. The citing work is GeoQA.
These citations show two directions in which the problem of structured mathematical interpretation continued. The tree-structured solver foregrounds the form of the mathematical output and its semantic alignment. GeoQA foregrounds the setting in which input evidence must support numerical reasoning. The 2015 paper supplies a concrete reference point for both: a solver that restricts the equation structures to a known inventory, enumerates numerical interpretations within that inventory, and tests whether its learned preferences recover the answer.
Cite
Cite as Lipu Zhou, Shuaixiang Dai and Liwei Chen. 2015. Learn to Solve Algebra Word Problems Using Quadratic Programming. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{zhou2015learn,
title = {{Learn to Solve Algebra Word Problems Using Quadratic Programming}},
author = {Lipu Zhou, Shuaixiang Dai and Liwei Chen},
booktitle = {Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing},
year = {2015},
doi = {10.18653/v1/d15-1096},
url = {https://doi.org/10.18653/v1/d15-1096}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/zhou-2015-learn-solve-algebra-word-problems/