Elamur Research

Automatically Solving Number Word Problems by Semantic Parsing and Reasoning

Paper · 2015 · Shuming Shi, Yuehui Wang, Chin-Yew Lin et al.

Summary

A solver can know how to solve an equation and still have trouble finding it in a sentence. A number word problem may introduce unknown quantities, describe how they are related, and refer back to them in a new way before asking for their values. SigmaDolphin, the system presented in this paper, divides that work into stages. It first turns the wording into a structured account of the quantities and their relationships. It then works out which mathematical constraints follow and solves for the requested values. The first stage is an instance of semantic parsing.

The authors designed a language called DOL for the intermediate representation. In a DOL tree, a function can express an operation such as addition, an assertion such as equality, or a modifier such as evenness. Each function specifies the kinds of arguments it can take. A parser using a context-free grammar with 9,600 rules builds the trees and checks those requirements. The authors assembled the rules semi-automatically. They wrote the mathematical entries using books and tutorials, and broadened the vocabulary with Freebase and lexical information extracted from the web. The parser uses no learned rule probabilities.

The reasoning stage interprets the trees from their leaves upward. Some parts become expressions for quantities, while others contribute equations or inequalities. DOL can also preserve a phrase such as “the smaller number” with its own temporary identifier until the reasoning stage can connect it to an unknown introduced earlier. The phrase supplies information about the intended referent, an instance of coreference resolution.

On the full test split of 1,504 number word problems, Dolphin, the name used for SigmaDolphin in the results, achieved 95.4% precision, 60.2% recall, and 73.8% F1. Precision measures the share of its returned answers that were correct. Recall measures the share of all test problems it answered correctly, including unanswered problems in the denominator. Dolphin led the statistical baselines on every subset where they could be compared. The authors built the grammar and parser using the development split. When they inspected unanswered development problems, they traced most of them to empty parses. They also encountered successful parses from which the reasoning stage could derive no usable mathematics. The evaluation establishes the approach’s performance on problems about numbers themselves. Applying it to broader word problems would require more extensive coverage of properties, relations, and actions.

Deep dive: Automatically Solving Number Word Problems by Semantic Parsing and Reasoning

How SigmaDolphin turns number word problems into equations, why its answers are usually correct, and where its grammar and reasoning fall short. · about 37 minutes to read

The problem and its context

The work that precedes calculation

A number word problem describes the unknowns as numbers, integers, or other mathematical objects. A problem might establish that one unknown exceeds another, describe a calculation involving the smaller of the two, and ask for both. To solve it, a system must establish which expressions refer to the same quantity, determine what operations the wording specifies, and recognize which statements constrain the answer. An equation solver can take over after those decisions have been made. SigmaDolphin addresses the passage from the written problem to the equations and the quantities the question requests.

The paper’s examples illustrate several kinds of work within this apparently narrow task. In one, the unknown is an even integer that participates both directly and through its square. In another, the two digits of an unknown number are separately constrained, and the full number participates in a further relation. A problem about consecutive even integers distinguishes members of a group by their positions. All of these are number word problems, yet the quantities have different structures. An integer can have a property, a number can have parts, and a group of numbers can have ordered members. Those distinctions matter when deciding what the equations should contain.

Even a short comparison can distribute its information across sentences. The phrase that introduces a number may give it a place in a comparison without naming it. A later description can identify it by that place. When the problem refers to the smaller unknown, the comparison already stated provides a way to settle the reference. A representation that retains only the arithmetic operation would discard the words that describe which unknown belongs in it. A representation that commits to a particular variable at the first encounter with the phrase needs enough context to justify that choice.

A further distinction concerns operations and assertions. A sum refers to a quantity, even when the values of its terms are unknown. A statement equating that sum with another quantity supplies a constraint. A question directs the solver to the values it should return. Prose can put all these elements close together, and a single sentence can contain operations nested inside other operations. SigmaDolphin’s design treats their roles explicitly so that the resulting expressions can be passed to the solver in a useful form.

Earlier word-problem systems

The authors trace automatic word-problem solving back to symbolic systems. Bobrow’s STUDENT dealt with algebra problems by transforming sentences into simpler forms and repeatedly applying patterns to obtain mathematical expressions. CARPS took a related approach to English rate problems and used a tree to organize the information collected about an object. The paper also mentions work that represented problems with augmented semantic networks and describes addition and subtraction as a prominent focus of early research. STUDENT is discussed in Natural Language Input for a Computer Problem Solving System.

The authors question how far individually designed transformations can be trusted when wording varies. One older system, for example, treated a comma followed by a conjunction as a possible boundary. Applied to a sentence listing several kinds of fruit, the pattern could detach the final item from the sentence that says who has it. Arithmetic is still remote at that point. The error concerns the scope of a list and the relation between a phrase and the rest of its sentence. A grammar can represent that list as a constituent and let a larger rule combine it with the rest of the statement.

The evidence available for early approaches also shaped the paper’s design. The authors describe a literature in which examples frequently served as the main demonstration. Where numerical evaluation existed, they found it difficult to tell whether the test sentences had influenced the patterns under evaluation. For a hand-built system, the distinction is consequential. A grammar writer can deliberately generalize a construction after seeing it in development, but the resulting rule’s ability to account for fresh wording has to be measured on other problems.

The paper also discusses statistical approaches. Hosseini and colleagues learned categories of verbs for a class of addition and subtraction problems. Kushman and colleagues used annotated equations and solutions to learn how to map new problems to equation templates. A template records the structure of a system of equations so that related problems can share a form despite differing values. The 2015 paper uses the latter method as a baseline under the name KAZB. These approaches teach a solver different things from its examples. Verb categories help identify the role an event plays in arithmetic, while equation templates associate a problem with a form of solution already represented in the training material.

The distinction matters for the proposed system’s intermediate steps. Retrieving an equation form can be effective when the training collection contains sufficiently similar problems. DOL instead gives the parser and the reasoning stage a shared vocabulary for describing what individual pieces of the input say. The resulting tree identifies such things as a sum, its arguments, a numerical property, or an equality. A reasoning rule can use that local structure wherever the grammar finds it, including inside a sentence with a larger arrangement of operations.

What the representation needs to preserve

The authors place DOL beside work that analyzes predicates and their arguments. Knowing who did something, what they acted on, or which participants appear in a relation is useful. A math solver also needs to combine the meanings of quantities inside those roles, distinguish mathematical restrictions from ordinary descriptive details, and retain enough structure to determine what a question requests. The paper discusses these earlier approaches under semantic role labeling and Frame-Semantic Parsing.

The paper also considers approaches that map text into logical forms. In the authors’ account, many of the systems they discuss addressed short queries within restricted domains. A number problem can spread its constraints over several sentences and use descriptions whose referents depend on those constraints. The comparison problem captures the issue. A logical form for the completed problem can use a single variable wherever the smaller unknown is mentioned. Constructing that form directly requires making the identity decision while translating the text. DOL gives the later reasoning stage access to the original description in structured form. The paper situates these choices alongside work such as Semantic Parsing on Freebase from Question-Answer Pairs.

The authors also compare DOL with Abstract Meaning Representation and combinatory categorial grammar. In their comparison, Abstract Meaning Representation can give a clause about an event and a noun phrase naming that event a common representation. DOL preserves the distinction between the clause and the nominal form in its choice of node. Its clause-level verb functions and its noun functions serve different roles when the system derives equations. The authors also emphasize DOL’s type inventory, its compatibility checks, and its provision for lists. Abstract Meaning Representation for Sembanking

In the paper’s description of combinatory categorial grammar, individual words carry semantic information that can be combined through the grammar. DOL’s rules can associate a whole word pattern with a semantic operation and identify the places from which its arguments come. A power construction can therefore specify which phrase supplies the base and which supplies the exponent. The parser is still composing meanings, but its rules can name the contribution of a multiword construction directly. This is useful in a domain where the role of a phrase often depends on the expression that contains it. The paper discusses learned grammars of the former kind in work such as Online Learning of Relaxed CCG Grammars for Parsing to Logical Form.

The method, step by step

From a sentence to something the solver can use

Consider the paper’s example of two unknown numbers. The first sentence supplies an offset of 16. The next uses the smaller unknown, a fraction of the larger one, and a fraction of their sum in a single relationship. The question asks for the unknown numbers. The output the system needs from the language analysis is a set of simultaneous constraints together with the identities of the quantities to report. Here is the first equation used to illustrate the task.

x = 16 + y

The symbol x denotes the larger number and y the smaller one. The constant 16 is the difference supplied by the first statement. The + sign adds that constant to the smaller value, and = asserts that the result is the larger value. This assignment of x and y describes the completed interpretation.

(2/3)x − y = (x + y) / 4

Here x and y retain their meanings. The fraction 2/3 multiplies the larger quantity by juxtaposition. The minus sign subtracts the smaller quantity from that product. On the right, parentheses group the sum marked by +, and / 4 divides the sum by the stated denominator. The equality sign makes those expressions parts of a single constraint. In particular, the subtraction wording determines which quantity is taken away and which expression it is taken from.

For the authors, this example motivates a stage between the text and the equations. The language analyzer can identify the comparative description, the subtraction construction, the sum, and the fractions before the system settles every reference. It can preserve the difference between the introductions of the unknowns and the later descriptions of them. The reasoning stage then has structured material to interpret, including the relationships that can establish which mention belongs to which unknown. That shared representation is the basis of the division of labor between parsing and knowledge representation and reasoning.

From number word problem to answer

The steps in order.

From number word problem to answerStep 1: Match sentence spans to DOL grammar rules1. Match sentence spans to DOL grammar rulesStep 2: Build candidate trees and check argument types2. Build candidate trees and check argument typesStep 3: Select the highest-scoring valid tree3. Select the highest-scoring valid treeStep 4: Interpret subtrees and resolve deferred references4. Interpret subtrees and resolve deferred referencesStep 5: Collect mathematical constraints and identify requested quantities5. Collect mathematical constraints and identify requested quantitiesStep 6: Solve the resulting equations6. Solve the resulting equations

What a DOL tree contains

A DOL tree represents a sentence or a smaller meaningful piece of text. Interior nodes apply functions. At the leaves, the tree can use constants, classes, or functions that take no arguments. A constant identifies a particular value or object. A class identifies a category, such as numbers or cities. A function combines its arguments and declares the type of the result. The tree grows by applying an operation higher up to values or structures supplied below it.

Classes give the type checker a way to handle general and specific categories. A number can occur where a mathematical expression is required because the class of numbers is included in the class of mathematical expressions. The paper makes the same distinction in its broader vocabulary by placing pianists under performers. Formally, its numerical example is:

math.number ⊆ math.expression

The names math.number and math.expression designate DOL classes. The relation ⊆ says that every member of the class on the left belongs to the class on the right. A literal number can consequently fill an argument that expects a mathematical expression. A function that produces a more complicated expression can fill that same argument when it declares the corresponding return type.

Classes can also be parameterized. This is particularly useful for collections, because a list can be characterized both by the kind of thing it contains and by its size. The paper gives the following general form.

t.list⟨c, m, n⟩

The name t.list denotes the list template. The angle brackets enclose its parameters. The symbol c is the class of the elements, m is the minimum length, and n is the maximum length. Both bounds are inclusive. The paper uses +∞ to represent an unbounded maximum. The same template can describe a list of numbers, a list of integers, or a list of more general mathematical expressions.

A function has a name, a specification for its core arguments, and a return type. DOL supports multiple argument specifications under one function name. The sum function, for instance, has a version for two separate expressions and another for a list of expressions with at least 2 elements. The first version fits a phrase joining operands with “plus.” The list version fits a phrase that names the operation and gives a collection whose members are its operands. The function can have a fixed interface even when the number of operands varies.

One distinction in the paper’s examples is between listing values and describing a list whose values remain unknown. The representation can hold a collection of explicit addends. It can also express a collection by giving an element class and the number of elements. In the latter case, the noun function nf.list can describe a list of numbers without first knowing the value of any member. Its inputs specify what kind of object each member is and how many members there are. A sum over the list can still be interpreted symbolically.

Nouns, assertions, and modifiers

The names of DOL functions reflect their grammatical and semantic roles. Noun functions represent entities, properties, or related objects described by noun phrases. Some are mathematical. A numerator function takes a fraction and returns a number, and a greatest-common-divisor function takes a collection of integers and returns an integer. The paper also gives the example of a height function that applies to a concrete entity and returns a length. These signatures record what an operation makes sense for and what kind of value another function can expect from it.

The noun-function category includes pronoun functions. They can take no arguments while indicating something about reference. The function nf.it points to an entity or event mentioned earlier, and nf.what stands for an unknown entity or collection. A question can therefore supply a representation of what is being asked for even though finding its value is the purpose of the rest of the computation. At the tree level, such an occurrence is a leaf with a defined role.

Verb functions represent clauses. An equality function takes quantities and represents the assertion that their values agree. DOL can also define verb functions outside the immediate arithmetic task. One example in the paper takes an agent and a predicate and represents that agent’s belief in what the predicate says. The predicate occupies a defined argument position, just as the quantities occupy defined positions in the equality function. A clause can thus be a typed argument inside a larger clause.

Modifier functions let a tree keep information expressed by adjectives, adverbs, and phrases that modify another part of a sentence. A function has slots for its core arguments and can also take extensions that modify it. In the example about an even integer and its square, the evenness modifier attaches to the noun structure introducing the number. The operations surrounding that number use it as a quantity. The modifier records a restriction on the quantity that can survive when the reasoning stage derives equations.

Keeping these roles distinct makes it possible for a small part of a tree to contribute useful mathematics even when the whole tree represents something larger. An assertion can contain a sum, which contains a list, which contains an unknown with a property. The sum supplies an expression, the assertion supplies a constraint, and the property can supply an additional constraint. The different contributions follow from where the nodes attach and how the authors define their interpretations.

References can wait for more information

DOL gives subtrees entity identifiers. When several subtrees have the same identifier, they are understood to refer to the same entity. In the example involving an even integer, its square, and a question about the number, the authors show a shared identifier on mentions distributed across the statements and the question. A square needs the underlying quantity as its argument, and the question asks for that quantity. The identifier lets the mathematical interpretation preserve this continuity.

The comparison problem requires a different treatment. The parser encounters explicit introductions of unknown numbers and later descriptions based on relative size. The paper describes giving the smaller-number description a fresh identifier at first and allowing the reasoning stage to settle its identity. The DOL subtree still retains the noun phrase and its description. The temporary identifier keeps track of the mention without forcing an early choice about which existing unknown it denotes.

The point of retaining the subtree is that the noun phrase carries evidence a bare variable would leave behind. A modifier can distinguish a larger entity from a smaller one. Plural wording can signal a collection, and determiners can help preserve how an expression picks out an entity. The authors give the design and its motivation through examples. The comparison illustrates the handoff between stages, with the parse preserving the available information and the reasoning stage using it when the relevant relation can be established.

Entity identifiers and algebraic variables consequently serve related purposes at different steps. An entity identifier marks a piece of the representation so its interpretation can be shared or resolved later. An algebraic variable stands for a value in the constraints the solver receives. Giving a description its own initial identifier keeps the semantic structure available while the system works out which algebraic quantity should occupy that position.

How the rules connect words and meanings

The grammar pairs a DOL element with a pattern of words and argument slots. Its left side names a function, class, or constant. Its right side describes wording with which that element can be expressed. For a mathematical operation, the right side can place an argument slot before or after a particular word. The parser uses the rule in the direction needed to recover the DOL element from the sentence and fills the slots with the subtrees found for those spans.

For equality, the paper shows rules for wording equivalent to “equal” as well as copular wording. Those patterns can all supply the same equality function with two quantity arguments. Its addition rules likewise connect both the direct “plus” construction and the construction in which one quantity is described as added to another. For a noun phrase naming a sum, the rule can assign the entire collection to a list argument. These choices keep recurring semantic operations in one vocabulary while giving the grammar more than one way to recognize them.

How a word pattern lays out arguments can matter independently of the semantic role assigned to them. The paper’s giving example includes a construction that places the object before a phrase identifying the recipient and another that puts the recipient first. The grammar marks the relevant slots so that the function can still receive the giver, the object, and the recipient in their specified roles. In arithmetic, the same ability is important for constructions whose operand order affects the result, as in the worked subtraction example.

The example parse for a sentence stating that nine plus an integer equals 314 shows the distinction between a grammar rule and the semantic tree it yields. The parser can account for the words that indicate equality without leaving each of them as an independent argument in the final tree. The equality node has the sum on one side and the numerical constant on the other. The sum, in turn, has a numeric operand and the unknown integer. The textual pieces used to recognize these constructions have done their work once the corresponding functions and argument positions have been identified.

Where the lexicon and grammar came from

The lexicon and rules were developed together. The initial mathematical material came from the authors’ review of textbooks and online tutorials, which yielded about 35 classes and 200 functions. The paper also reports over 50 manually defined math-related verb functions. These figures describe different parts of the construction work. A class, a function, and a grammar rule are different objects, and one function can have several rules for recognizing its surface forms. The reported grammar total is 9,600 rules.

To extend the inventory of classes, the authors imported Freebase types and used links between the types and their names to obtain lexical rules. They also used a web snapshot of 3 billion pages to extract terms and the categories they could belong to. One of the paper’s examples pairs a person’s name with the category actress. Such an extraction supplies a candidate instance and a type name. The type name can then become a DOL class with a grammar rule that recognizes its lexical form. The paper credits earlier approaches including Automatic Acquisition of Hyponyms from Large Text Corpora.

The web procedure also produced a graph of similar terms. The authors used this graph to clean up the extracted instance–category pairs, drawing on the expectation that peers tend to share some type names. They ranked the resulting type names by weight and manually created classes for the top 1000. For the other 2000 names in the top 3000, they generated class names and lexical rules automatically. The paper gives actress as an example of a class created with a more specific name in the hierarchy, and succulent as an example of direct automatic construction.

Noun functions came from additional sources as well. Freebase properties and extracted attributes could supply candidates for functions that relate an entity to a property or another entity. An English adjective and adverb list supplied material for generating more modifier functions. The mathematical verbs were handled manually at the time of the paper. The authors describe verb resources as sources for future automation, including From TreeBank to PropBank.

These procedures provide a vocabulary the parser can recognize and type. The mathematical interpretation of individual nodes is a further resource that the authors wrote manually. Recognizing a category word can be useful for building and checking a tree, while the tree may still require another function to establish what calculation a relation entails. The distinction between recognizing an expression and interpreting it mathematically becomes important in the analysis of unsuccessful problems.

The development split served as the collection the authors could consult when constructing and debugging the parser. The method had no supervised training stage on the word problems that estimated probabilities for grammar rules. Resource construction still involved human choices about what functions to include, which patterns should express them, and how they should be interpreted. The paper’s experimental split therefore matters for a rule-based method as much as a training split matters for a statistical one.

How the parser chooses a tree

The authors implemented a top-down parser following Earley’s method. The search uses dynamic programming, meaning that partial parsing results can be kept and reused when they matter to more than one candidate. A sentence may fit several patterns in overlapping ways. Reusing earlier work lets the parser explore those combinations without having to reconstruct each shared subanalysis each time it appears. The authors had no annotated treebank for the DOL grammar, so its rules carry no fitted probabilities.

A candidate tree must satisfy the argument requirements of its functions. For example, the power function can return a mathematical expression that fits the quantity slot of an equality assertion. A sum function expecting a list cannot take a bare numerical constant in that slot. A list intended for addition must contain expressions of the required type, which rules out a list with a person’s name as an addend. The grammar may recognize the pieces of such a phrase, while the function’s argument specification rules out the proposed combination.

The parser assigns a score during construction. For an interior tree, the paper defines the score as a length-weighted average of the immediate subtree scores, multiplied by an indicator for type compatibility.

S(T) = (∑ᵢ₌₁ᵏ L(Tᵢ) · S(Tᵢ)) / (∑ᵢ₌₁ᵏ L(Tᵢ)) · p(T)

The symbol T denotes the tree being scored and S(T) its score. The index i ranges from 1 through k, where k is the number of subtrees directly contributing to this calculation. Each Tᵢ is one of those subtrees. The function L counts the words in the original text spanned by a subtree, and S(Tᵢ) is that subtree’s score. Each ∑ adds the indicated terms across the indexed subtrees. The dots denote multiplication, and the division by the total span weights makes the expression a weighted average. The factor p(T) is 1 when the type constraints for T are satisfied and 0 otherwise. It gives a type-incompatible combination a score of zero.

Most leaves receive a score of 1.0. Leaves that are pure lexical strings, used as names for entities, receive a different score.

1 / (1 + μn)

The symbol n counts the words in the lexical string. The parameter μ is set to 0.2 in the experiments. The product μn is added to the constant 1 in the denominator, and the other 1 is the numerator. This rule lowers the score of treating a span as a raw name, with a larger penalty for a longer span. It favors using the grammar to account for the words when a structured reading is available.

Type checking and the string penalty have different jobs. Type checking asks whether a proposed function application is allowed by the DOL signature. The string score expresses a preference about how to account for the text. A tree can use lexical names and remain valid. When it competes with a tree that recognizes more of the text through structured rules, the score gives the parser a way to prefer the latter. The parser returns the candidate with the highest score. If the highest score is zero, it returns an empty tree.

How the reasoner produces mathematics

The paper distinguishes expressions that denote quantities from expressions that make assertions. It calls quantity expressions n-expressions. A constant, an unknown, or a sum can play that role. Its s-expressions include equations and inequalities, which state conditions on quantities. The distinction determines what the traversal does with a derived expression. A quantity can be handed to the interpretation of a parent node. An assertion can be collected as a condition the solver must respect.

The derivation algorithm visits the children of a DOL node before interpreting the node itself. It recursively obtains the expression for each child and adds any child assertion to a shared expression list, which the paper calls XL. Once the children have been interpreted, the current node’s rule supplies its expression, and the recursive call returns that result. This order allows the interpretation of an equality to use expressions already built for the quantities on each side. It also gives a modifier a way to contribute a constraint from inside a larger tree.

The example containing 314 illustrates the difference between a subtree result and a sentence result. At the sum node, the integer introduced by the sentence can be represented by an unknown, and the left subtree yields the sum of nine and that unknown. At the equality node, the reasoner uses that result alongside the numerical constant.

9 + x = 314

The constant 9 is the expressed addend and x represents the integer introduced by the sentence. The + sign constructs the left-hand sum. The constant 314 occupies the other side of the equality, and = makes the whole expression a constraint. The parse identifies the components and their roles. Their mathematical interpretation provides the equation.

The paper gives several representative interpretation rules. The notation below uses a₁ and a₂ for the argument positions of a DOL function. Equality has the following interpretation.

X(a₁) = X(a₂)

Here a₁ and a₂ are the first and second argument subtrees. The function X gives the mathematical expression derived from its argument. The equality sign states that the values of those expressions agree. The result is an s-expression because it constrains the two quantities.

For the form of addition with two separate arguments, the interpretation is:

X(a₁) + X(a₂)

The symbols a₁ and a₂ again stand for the two argument subtrees, and X interprets each. The plus sign combines the two resulting expressions. This yields an n-expression, which can feed into another operation or become part of an assertion.

The list form of the sum uses a different argument structure.

∑ₑ ∈ a₁ X(e)

The symbol a₁ is the argument supplying the list, e is a member of that list, and ∈ indicates membership. The symbol ∑ means to add the quantities contributed by the members, with X(e) giving the expression for each member. The number of terms follows from the collection supplied by the tree. The reasoning rule can therefore handle different list lengths through the same function.

The paper gives a further list-based interpretation for greatest common divisor.

gcd({X(e) | e ∈ a₁})

The operation gcd takes the greatest common divisor of the quantities inside the braces. The vertical bar means “for,” with the condition to its right specifying that e ranges over members of a₁, the list argument. The symbol ∈ denotes that membership and X(e) gives the mathematical expression for the member. The DOL signature separately specifies the admissible list of integers.

When an expression describes a list of unknown quantities by class and size, its interpretation can introduce a collection of variables.

V = (v₁, v₂, …, vₙ)

The symbol V names the collection. The symbols v₁, v₂, through vₙ are its variable entries, and the ellipsis continues the sequence up to its last entry. The symbol n is the number of entries, obtained by interpreting the size argument of nf.list. The parentheses and commas mark the collection of entries. The result gives the reasoner objects it can use when the text refers to the list or to operations over its members.

An evenness modifier contributes a constraint on the quantity it modifies.

X(h) % 2 = 0

The symbol h denotes the node to which the modifier attaches, and X(h) is the value expressed by that node. The sign % denotes the remainder after division by 2. The equality sign requires that remainder to equal 0. The modifier can consequently add an s-expression even when its host is a noun phrase and the host’s own contribution is an n-expression.

The interpretation rules are hand-built, and the authors allow some kinds of nodes to have an empty interpretation in a number problem. Most class nodes and many adverbs can be handled that way. A class still helps specify what sort of object was introduced, even when it contributes no separate arithmetic expression. A modifier such as evenness has an explicit mathematical consequence, so the reasoner handles it with an interpretation that contributes a constraint.

The reasoner uses the derived expressions to solve the system and calculate the values requested by the problem. The paper describes this overall handoff and gives the recursive derivation procedure. Its worked examples concentrate on how the constraints arise. For the comparison problem, the equations require the same larger and smaller quantities to occur consistently across statements. For the example with 314, the left subtree’s value must reach the correct side of the assertion. These are the inputs the final algebra depends on.

Experiments and results

The collection and its splits

The authors collected 1,878 number word problems from algebra.com and Yahoo Answers. On algebra.com they sampled from the category devoted to number word problems. On Yahoo Answers they sampled from the mathematics category and used human annotators to identify the problems of the desired kind. The resulting collection brings together problems from a specific category on one site and a manually filtered category on the other. The paper makes the problem collection available with the worked equations and answers added by annotators.

The authors randomly assigned 374 problems to development and 1,504 to test. Development was the material they consulted for design and debugging. The test split supplied the held-out problems for Dolphin’s evaluation. Human equation annotations had a second use in the baseline experiments, where they provided training examples and helped determine which subsets were compatible with the template-based method. The experiment therefore uses annotations both to document the expected mathematics and to support evaluation and benchmarks.

The full development split averaged 1.79 sentences and 20.3 words per problem. The full test split averaged 1.75 sentences and 22.5 words. These are averages over problems in their respective splits. A problem can be short by either measure while still requiring reference resolution across statements or several operations inside a sentence. The collection statistics give a sense of the amount of text involved, while the actual examples show why the dependency structure of that text matters.

The authors also report results on the Linear subset, with 247 development problems and 986 test problems. This subset keeps problems whose annotated equations are linear. The LinearT2 subset contains 172 development problems and 669 test problems, and it retains problems whose equation templates have at least 2 associated examples. LinearT6 has 71 development problems and 348 test problems. The paper sets the stricter template requirement using the threshold of 6 encountered in the earlier KAZB collection. These are progressively filtered parts of the collection, and each result belongs to the specified split.

The filtered test sets also differ in average length. Linear averages 1.72 sentences and 19.0 words per test problem. LinearT2 averages 1.71 sentences and 17.4 words. LinearT6 averages 1.80 sentences and 16.1 words. Filtering by equation form and template frequency therefore changes more than the set of templates a baseline is allowed to use. The four evaluations are related, and differences between their scores have to be read with their membership in mind.

What each baseline could use

KAZB learns to associate a problem with an equation template derived from its annotated training examples. The authors used its ALLEQ version, which they describe as performing better than the alternative versions. The implementation supports linear equations and requires at least two problems for each template. LinearT2 supplies problems satisfying those conditions. The authors also evaluate on LinearT6, which applies the stronger frequency requirement used when constructing the comparable setting. They report KAZB scores for those filtered test sets.

BasicSim finds the training problem most similar to the problem under evaluation and applies its equations. The paper presents it as a simple statistical comparison that performed similarly to KAZB on the earlier collection. BasicSim can be run over the wider range of equations in the new collection and has no corresponding minimum template frequency requirement. Its results appear for the full test split and all of the filtered test sets.

For both baselines the authors used 5-fold cross-validation. Each fold’s training material included the development set and 4/5 of the relevant test set. Performance was measured on the portion held out in that fold. Dolphin was built using development and evaluated on test. The baseline scores therefore represent systems with access to annotated training problems from the evaluation collection outside each fold’s held-out portion. The contrast in data use reflects the two different construction procedures and belongs alongside the numerical comparison.

Both baselines returned an answer for every evaluation problem. A nearest-neighbor system can always choose the most similar item in its training pool under its similarity rule, and the template baseline operated on subsets prepared for its requirements. Dolphin’s design allows an empty result when it cannot produce a satisfactory parse or derive an answer from it. The evaluation therefore records both the reliability of returned answers and how broadly the system solves the problems.

What the metrics count

The paper defines precision, recall, and F1 using the total number of evaluation problems, the number answered, and the number answered correctly. Precision is:

P = k / m

The symbol P denotes precision, k counts problems answered correctly, and m counts all problems for which the system gave an answer. The slash marks division. A wrong answer enters the denominator, while an unanswered item is outside this denominator.

R = k / n

Here R denotes recall, k again counts correct answers, and n counts the whole evaluation set. The division measures the share of all problems solved correctly. The paper also calls this coverage. In these experiments, the figure includes correctness in its numerator, so it differs from the share of problems for which a system issued any answer.

F1 = 2PR / (P + R)

The label F1 names the combined measure, P is precision, and R is recall. Juxtaposition in the numerator multiplies the constant 2, precision, and recall. The parentheses in the denominator group the sum of the two measures. The resulting harmonic mean gives weight to both the reliability and the breadth of the correct answers. The paper also gives its equivalent in terms of counts.

F1 = 2k / (m + n)

The symbol k still counts correct answers, m counts problems answered, and n counts all evaluation problems. The constant 2 multiplies the correct-answer count, and the denominator adds the number answered to the evaluation-set size. For the baselines, every problem received an answer. In that case the precision, recall, and F1 values coincide, and each equals the share of problems answered correctly.

How the systems performed

On the full test split, Dolphin achieved 95.4% precision and 60.2% recall, giving it an F1 of 73.8%. The precision figure is conditional on receiving an answer. The recall figure is the correct-answer share for the test split as a whole. BasicSim recorded 29.0% on each of the three metrics because it answered every problem. This comparison evaluates the broadest collection the paper uses, within the scope of number word problems.

Dolphin and BasicSim on the full number word problem test split by F1

Dolphin leads the nearest-problem baseline when both correct-answer coverage and precision count.

Dolphin and BasicSim on the full number word problem test split by F1BasicSim: 29.0BasicSim29.0Dolphin (this paper): 73.8Dolphin (this paper)73.8
The numbers
System or settingF1 %
BasicSim29.0
Dolphin (this paper)73.8

On the Linear test subset, Dolphin attained 95.7% precision, 63.6% recall, and 76.4% F1. BasicSim scored 32.3% on all three metrics. This comparison concerns problems with linear equation systems, including examples outside the template-frequency subsets. Dolphin’s precision remained high in this part of the collection, and its correctly solved share of the subset exceeded BasicSim’s.

All three systems appear on LinearT2. Dolphin reached 97.3% precision, 68.0% recall, and 80.0% F1. BasicSim scored 46.3% on precision, recall, and F1, while KAZB scored 37.5% on each. The comparison shows the results of the learned equation-template method and the nearest-problem method under the minimum template support required by the KAZB implementation.

On LinearT6, Dolphin produced 98.1% precision, 72.9% recall, and 83.6% F1. BasicSim scored 59.7% on all three metrics, and KAZB scored 49.1% on all three. Both baselines’ correct-answer shares were higher on this subset than on LinearT2. Dolphin’s scores were also higher. These results apply to the more restricted set of problems associated with often represented equation templates.

Dolphin and the statistical baselines on LinearT6 test by F1

Dolphin has the highest F1 on the subset restricted to frequently represented equation templates.

Dolphin and the statistical baselines on LinearT6 test by F1KAZB: 49.1KAZB49.1BasicSim: 59.7BasicSim59.7Dolphin (this paper): 83.6Dolphin (this paper)83.6
The numbers
System or settingF1 %
KAZB49.1
BasicSim59.7
Dolphin (this paper)83.6

The authors report that Dolphin’s advantages over the available baselines are statistically significant on each test set, for precision, recall, and F1, according to a two-tailed t-test. They give the significance level as:

p ≪ 0.01

Here p is the reported p-value for the statistical comparison, and ≪ conveys the authors’ description that it is much smaller than 0.01. This p refers to the significance test. The similarly named factor in the parsing formula serves only as a type-compatibility indicator.

Dolphin’s high precision and lower recall describe a solver that often returns trustworthy answers within its scope and still leaves a substantial portion of the collection unsolved. Its recall also exceeds the correct-answer share of every reported baseline in the corresponding comparison. In this experiment, the ability to decline an answer coexists with a higher share of correct outcomes across the tested problems. Those measures together are what support the authors’ interest in uses where an incorrect returned answer matters.

What the ablations show

The paper offers no component-removal ablation, and its analyses instead consist of comparisons across problem subsets, an observation about the lexical-string penalty, and inspection of unsuccessful cases.

Comparing problem subsets

The progression from the broader subsets to LinearT2 and LinearT6 is informative because it changes the kinds of problems each system sees. The template-based baseline was restricted to settings that could support its implementation. Its higher result on LinearT6 accompanies a restriction to templates with more examples. BasicSim improves on the same subset as well, which is compatible with its reliance on finding a useful precedent. Dolphin also improves across those subsets, although its grammar and reasoning rules were developed by a different procedure.

These comparisons show where the systems did well on the collection. They leave the separate effect of template frequency unresolved. The subsets differ in their membership and descriptive statistics, and restricting them changes which equations and wording the systems have to handle. In particular, the higher scores on LinearT6 belong to the systems evaluated on that selected group. They do not provide an estimate of the gain that would result from increasing the number of training examples for the same set of test problems.

The consistent lead for Dolphin across the reported comparisons gives the evaluation more scope than a result on one template subset alone. The full test result includes problems outside the restrictions of the KAZB implementation, while the template subsets allow a direct comparison with that method. Together they show that the ranking holds under both a broad evaluation against BasicSim and the comparisons on narrower sets where KAZB could run. The paper does not use these comparisons to isolate a particular DOL feature.

What inspection says about failures

The authors examined development problems for which the system generated no answer. Most had an empty parse. That diagnosis locates a common failure before the reasoner can use the sentence. It indicates that a substantial portion of the inspected failures came from an inability to obtain a usable DOL tree. The parser can reach that outcome because its rules do not supply the necessary representation or because proposed constructions fail the checks it applies. The inspection identifies the stage at which the system ran out of an interpretation, and the paper does not give separate counts for those possibilities.

The authors also report a distinct kind of case in broader math word problems. The system can parse the wording and still fail to derive mathematical expressions. The authors associate some of these cases with relations or actions whose representations are insufficient for the inference needed. A recognized function and an admissible set of arguments can describe part of the language while leaving the mathematical effect of the relationship unspecified. This gives the distinction between the parser and the reasoner an observable consequence. There can be a usable grammatical and semantic structure at the intermediate stage and still be too little information for the algebra.

The authors explain the system’s high precision in terms of the structured quantity relations it obtains when a parse and a derivation succeed. The examples show a mechanism compatible with this explanation. The sum function rejects ill-typed inputs, argument positions preserve the direction of mathematical operations, and sentence interpretations turn recognized relations into constraints. The evaluation measures the combined system. The contribution of type checking, the ability to return an empty result, the grammar’s domain coverage, and the handwritten interpretations remains unmeasured individually.

For the lexical-string penalty, the paper says that the parameter’s value has little influence on parsing results and gives 0.2 as the setting used. There is no reported breakdown of values and corresponding scores. The observation is therefore a qualitative statement about sensitivity in the authors’ experience. The scoring equation still makes the intended preference explicit. A candidate that accounts for a phrase through grammar rules can outrank a candidate that accounts for the same span by treating it as a name.

Limitations

Limits identified by the authors

The authors explicitly restrict the experimental claim to number word problems. They describe general math word problems as more demanding because they can mention many more kinds of entities, properties, relations, and actions. A general problem may require knowing how an action changes a quantity, how a relation constrains several entities, or which property of an object is relevant to a calculation. Every such construction needs a path through both the language representation and the reasoning stage.

The paper distinguishes the authors’ vocabulary coverage for common entities from their coverage of the properties, relations, and actions involving those entities. Their grammar already recognized many common types. They report that unfamiliar properties, relations, and actions still prevented parsing in broader word problems. In other cases, the parser could identify a structure, but the available account of a relation or action was insufficient to derive the mathematical expressions. Broadening the type inventory addresses one part of the work. Useful interpretation also depends on how the rest of the system represents what entities do and how their quantities are connected.

The authors propose extending the lexicon and grammar and studying better ways to represent relations and actions. They also discuss possible extensions to other domains, including physics and chemistry. These are future directions in the paper. The reported measurements concern the number-word collection, so the performance of those extensions remains open.

Limits of what the experiment establishes

The evaluation combines the operation of the grammar, the type checks, the ranking rule, the reference handling, the semantic interpretations, and the final solver. Its unit of success is the resulting answer. That is suitable for measuring the task as a whole. It leaves open the quality of individual sentence parses, how frequently entity references were correctly resolved, and how often correct answers were reached through the intended equations. Although the collection includes equation annotations, the reported metrics measure final answers. A detailed assessment of the intermediate structures would require evidence about those structures.

The study also observes performance at the system’s reported way of deciding when it has an answer. The precision value describes returned answers over the test split. It does not give a confidence estimate for each individual answer, or describe how precision would change if the system used a different decision rule. The score for a DOL tree measures its compatibility and its treatment of the source words under the parser’s scoring procedure. The paper supplies no calibration connecting that score to the probability that a final answer is correct.

The construction of the collection affects how broadly its results can be interpreted. The problems came from two websites, with different procedures for locating number word problems. The random split supports a test on held-out items from that collection. Performance on an independently collected set, or on a collection of unfamiliar formulations with the same underlying mathematics, remains open. The paper’s examples also span several kinds of numerical descriptions, while the aggregate results leave performance for specific constructions, such as digit references or consecutive integers, undetermined.

The baseline comparison is well defined for the implementations the authors used. Its scope follows their input requirements and training procedures. KAZB’s results concern the linear, template-supported subsets. BasicSim gives a comparison across the complete test split. What the study establishes is the relative performance of these systems under those conditions. A broader conclusion about symbolic and statistical approaches in general would require comparisons with methods and datasets outside the experiment.

Finally, the paper describes reference resolution and expression derivation at different levels of detail. It presents a concrete motivation for delaying some identity assignments and shows how DOL preserves the structure needed for that delay. It also supplies recursive pseudocode and sample interpretation rules. The reported evaluation leaves the individual behavior of deferred references and the full range of manually specified interpretations less directly observable. The high-level design is clear, while the contribution of each kind of rule to the measured outcome remains a separate question.

What came after

Later work cites SigmaDolphin from several directions, including solver design, dataset construction, prompting, and evaluation. The citations establish a connection to the paper. The topics named by the works show how the language-to-mathematics problem appears in different research settings, while direct adoption of DOL, its grammar, or its reasoning rules remains undocumented here.

Semantically-Aligned Universal Tree-Structured Solver for Math Word Problems returns most directly to the question of solver structure. Its title places semantic alignment and a tree-structured solver at the center of the problem. SigmaDolphin used trees to represent the meanings of the input sentences, so that arithmetic operations, modifiers, and assertions could be composed and interpreted. The later work’s stated focus gives a point of comparison for where a tree serves a solver and what relationship that tree should preserve between wording and mathematics.

ArMATH puts the emphasis on a dataset for Arabic math word problems. The shared research problem is evaluation on written mathematics, with the later work explicitly centering Arabic. The 2015 study obtained its measurements by defining a problem category, collecting texts, and adding equation and answer annotations. ArMATH’s stated purpose places the availability of evaluation problems for a particular language at the center of that research direction.

Unleashing the Potential of Prompt Engineering cites the paper from research on prompting. The connection visible from its topic concerns the way a system is asked to handle a task expressed in language. SigmaDolphin put the mapping from words to structured mathematics in explicit grammar and interpretation rules. The later work’s stated emphasis is the design of prompts. Its citation shows that the earlier solver enters that discussion, while the particular role of its findings in the prompting method remains unspecified.

PyraMathBench cites the paper in work concerned with evaluating and improving mathematical capability. SigmaDolphin’s evaluation asked how precisely a system answered when it chose to respond and what share of the whole test set it solved. PyraMathBench names evaluation as part of a broader mathematical-capability project. The documented connection is between the earlier word-problem evaluation and a later work with that broader remit. Its title gives no basis for attributing SigmaDolphin’s measures or construction procedure to the later benchmark.

Cite

Cite as Shuming Shi, Yuehui Wang, Chin-Yew Lin, Xiaojiang Liu and Yong Rui. 2015. Automatically Solving Number Word Problems by Semantic Parsing and Reasoning. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/d15-1135

@inproceedings{shi2015automatically,
  title = {{Automatically Solving Number Word Problems by Semantic Parsing and Reasoning}},
  author = {Shuming Shi, Yuehui Wang, Chin-Yew Lin, Xiaojiang Liu and Yong Rui},
  booktitle = {Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing},
  year = {2015},
  doi = {10.18653/v1/d15-1135},
  url = {https://doi.org/10.18653/v1/d15-1135}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/shi-2015-automatically-solving-number-word-problems/