learning information onto external tools: Using ART for long document arXiv article summarization
Towards AGI Project
Kyle Roth, Georges Belanger Albarran, Alex Fulleringer
Overview: What is ART ?
Related work
There was a couple of work related such as :
Program Grammar
Task: “Answer this high-school Physics question.
Input: " Hector yanks...”
Followed by a sequence of sub-task nodes, represented as a (query answer) pair:
“Qi : ..., #i : ...”
The sub-task query Qi has a sub-task name and sub-task input :
“Q1: [search] What is the formula...”
The input node contains the task name, a simple instruction describing the task and the input for an instance of the task :
The sub-task answer #i is simply the output of the sub-task :
“#1: The horizontal component (Fx) can be calculated...”
The program ends with a dummy sub tasks :
“Q3: [EOQ]”
Followed a final answer node :
“Ans: 59N”
Tool Library
Whenever a sub-task query name matches a tool name in the task library e.g. “Qi [search]”, generation is stopped and resumed after the tool is called and its output is incorporated into the partially completed program. The following tools are used:
Search: "What is the formula for the horizontal component of tension force?"
Output: "…horizontal component (Fx) can be calculated as Ftens*cosine(theta)… "
Code generation: "Qi : [generate python code]"
Then, it will be prompted to codex in a multi-line comment in python:
"Use the formula Fx = Ftens*cosine(theta ) to solve ..."
Which will generate :
"T = 72.0 , theta = 35.0, … , Fx = T*math.cos(radians)"
Code execution:
"# (i -1): ..."
ART
A run-through of ART on a new task, Physics QA
A) Programs of related tasks like anachronisms and Math QA provide few-shot supervision to the LLM where related sub-steps and tools in these programs can be used by the LLM for cross-task generalization (shown in purple)
B) Tool use: Search is used to find the appropriate physics formula, and code generation and execution are used to substitute given values and compute the answer (shown in orange)
ART
<Prompt Input Text>
{Frozen LLM}
<LLM Output>
Tool Interface
Tool Shed
<Tool output>
<New Prompt Text>
Tool Call detected!
Tool call
+
+
=
Summary:
1) A chunk is used a prompt
2) Tool command is generated
3) LLM is paused as the tool generates it output
4) LLM continues its generation with the new information
5) Repeats until the 'eoq' tool is called or a maximum number of attempts is reached
"LLM Output Text"
"[Tool name] (tool inputs)"
FROZEN
ART
Summary:
1) A chunk is used a prompt
2) Tool command is generated
3) LLM is paused as the tool generates it output
4) LLM continues its generation with the new information
5) Repeats until the 'eoq' tool is called or a maximum number of attempts is reached
<Prompt Input Text>
{Frozen LLM}
<LLM Output>
Tool Interface
Tool Shed
FROZEN
<Tool output>
Tool Call detected!
Tool call
<New Prompt Text>
<New Prompt Text>
+
+
=
The New Tools
IDEA: Keep running summaries as a dict such that the model has easy access to topical saved information via the dict keys.
[List_Keys] <No Input>
{key1, key2, …}
Returns a string with all the summary dictionary keys delineated by commas.
[Read] <key>
{ <<Information stored at summary_dictionary[key]>>}
Returns the summary stored under that key.
[Write] <(key) section summary>
{}
Saves section summary to the save dict, does not return any text.
A Sample Prompt
A Sample Prompt
A Sample Prompt
Experimental setup and baselines
https://huggingface.co/spaces/evaluate-metric/rouge
https://paperswithcode.com/task/text-summarization
Experiments
Comparison on 10 examples between:
Base: original prompt
Bullets: prompted to produce shorter, bullet-point style intermediate summaries
Running summary: continually stores a running summary in the same key, loading and adding to it each time
Metric | Base | Bullets | Running summary |
rouge1 | 11.7 | 29.4 | 34.2 |
rouge2 | 4.0 | 9.7 | 8.8 |
rougeL | 6.1 | 15.1 | 18.7 |
rougeLSum | 8.2 | 23.1 | 27.3 |
Qualitative evaluation: 'rouge1': 0.35, 'rouge2': 0.12�Current summary having issues abstracting (stays on details)
GROUND TRUTH ABSTRACT: 'we study the phase behavior of a nematic liquid crystal confined between a flat substrate with strong anchoring and a patterned substrate whose structure and local anchoring strength we vary . by first evaluating an effective surface free energy function characterizing the patterned substrate we derive an expression for the effective free energy of the confined nematic liquid crystal . �
then we determine phase diagrams involving a homogeneous state in which the nematic director is almost uniform and a hybrid aligned nematic state in which the orientation of the director varies through the cell .
direct minimization of the free energy functional were performed in order to test the predictions of the effective free energy method .
we find remarkably good agreement between the phase boundaries calculated from the two approaches .�
in addition the effective energy method allows one to determine the energy barriers between two states in a bistable nematic device .'
{'current-summary': "The passage describes a study on the phase behavior of a nematic liquid crystal confined between a chemically uniform, asymmetrically grooved substrate with locally homeotropic anchoring and a flat substrate with strong homeotropic anchoring. The asymmetry of the grating substrate leads to a decrease in the groove depth at which a first-order transition between the h and han phases occurs. The energy barrier between the two coexisting states decreases with increasing asymmetry of the grating surface, but it is well above a typical nematic liquid crystal cell's energy barrier. The average director orientation at the grating surface in two bistable states has been calculated, and the difference between the two bistable states vanishes with increasing substrate asymmetry, which negatively affects the optical properties of a zenithally bistable nematic device."}
Challenges
Dirty code base:
ART authors didn’t take advantage of code reusability and versioning
Open AI API:
Monetary cost
Slow inference time
Rate limit
Prompt size limits
Parallelization of the pipeline
Conclusions