Holding the underlying language model (LM) constant, does providing different sets of functions and commands allow the model to solve more SWE-bench issues? The SWE-agent paper found a positive answer to this: 18% of issues were solved using their recommended interface, compared to 11% solved by a simple shell interface, both using GPT-4 Turbo. That is an observed difference of seven percentage points for this model on these 300 SWE-bench Lite issues. It is useful then to look at some of their ablation studies, where individual functions are altered. Yang et al., Tables 1, 3
There are many functions a LM would benefit from when editing code. For example, it would be useful to be able to quickly locate likely files and areas to look at, see the precise lines it intends to change, and see the effect of the change. Some other set of commands may allow all this to be achieved, but possibly over many commands. So two very different interfaces may allow essentially any desired change to the target files, but take very different amounts of time and number of actions.
Model, scaffold, interface, grader
There are at least 4 elements to be aware of when considering a published result. The LM produces outputs, including actions, based on its inputs. A scaffold will typically provide an initial set of instructions, drive a series of queries and responses, determine what previous information to include as input, and stop after some criterion. Part of the scaffold will provide commands, and the results of executing those, to and from the LM. And some mechanism will take the final proposed edits and test them, producing pass or fail. Altering any aspect could well alter the overall number of issues solved.
The issues and starting codebase come from SWE-bench, originally derived from a range of actual issues and fixes (PRs) from 12 popular Python projects. The system under test is expected to return appropriate edits to one or more files, which are then assessed with a combination of new tests specific to the issue and pre-existing tests. So the result is a proportion of issues solved to some degree. There could well be other aspects of the code changes and accompanying PR that would cause an experienced developer to reject them. Jimenez et al.
A leaderboard can include systems with different models, agent-computer interfaces and evaluation conditions. So to investigate the effect of the interface, it is best to restrict attention, at least at first, to a single paper. Ideally all the variations would have been given very similar descriptions of the required change, be on the same subset of issues, with the same model, and run the same tests. A system listed on SWE-bench may be very sophisticated, but tell you very little about, say, the value of one particular command.
Interface variations
These experiments used GPT-4 Turbo on the 300 issues in SWE-bench Lite.
| Variation on SWE-agent recommended setup | No. solved | Comments |
|---|---|---|
| Recommended interface | 54 (18.0%) | Baseline |
| Shell interface only | 33 (11.0%) | Substantial difference to above |
| Remove linting from editor command | 45 (15.0%) | Can still make targeted changes to file |
| Remove editor command | 31 (10.3%) | Can still edit file using other commands |
The recommended system solved 54 issues out of 300. The same system is reported to solve 286 issues out of 2294 in the test set, so the 12.47% result applies to quite a different number of issues. It would be misleading to compare the 12.47% with 18.0% to assess the effect of varying the interface. So I have expressed all the results above as a proportion of the 300 issues. Yang et al., various sections
Removing the dedicated editor reduced the observed resolution rate by 7.7 percentage points in this comparison. This could be taken to imply the value of allowing the LM to edit code! However, it can continue to edit files using various commands available in a standard shell. So it only removes one convenient means of editing part of a file, and viewing that area afterwards. There will be many sequences of actions available to produce a wide range of final changes.
An example of making a simple change using two interfaces may be helpful. Assume there is an issue with some code producing reports. If the last entry in the document is blank, an empty line appears in the table of contents. Lines should be included for all other headings. Assume the LM has found an appropriate function, only a few lines long. It decides that it needs to test whether there is a heading before adding a line to the report.
Using the editor it would specify the lines to replace and the replacement. It would then be shown those lines, plus some context above and below. If there were a gross error in the syntax of the new code, this would be detected and reported, and it could make a further attempt. Alternatively, using suitable shell commands, it could make an equivalent change, then ask to view some number of lines around the change. There are more opportunities to make errors here, or view a different area to the one intended. As mentioned, the syntax check would flag many errors, such as incorrect indentation, but it would be unlikely to flag the error of removing all lines with headings. It would need to generate suitable input, or find an appropriate existing test. So this feature could prove useful in some circumstances, but the LM needs to determine and check the more subtle requirement from the issue. Of course, none of this is related to any specific SWE-bench issue.
It might be assumed that viewing as much of a file as possible would be best. However all this information takes space away from other useful information, such as the description of the issue, actions taken so far, code likely to need altering. The SWE-agent paper varied the number of lines returned by their file-viewing command. Both 30 lines, and the whole file, did worse than their chosen default. So possibly key information was outside the range viewed, or alternatively the desired information was included, but "lost" in all the other lines. Individual traces could help distinguish these possible explanations. Yang et al. section 5.1
Similarly, returning as many results as possible from a search command seems attractive. However, this could result in many views of areas of code as the agent works down all the possibilities. Several examples are given of agents continuing to look at all results returned by a search, and so consuming much of their allowable time. So an extensive list of searches and file views may indicate poor use of time by the agent. It is worth checking that each subsequent action moves closer to identifying the code requiring a change. Yang et al. section 5.1
Running your own experiments
If you were considering adding a syntax check to your code-edit command, clearly the difference between shell only and all the SWE-agent commands is too large a change. So you would focus on the three-percentage-point gap between the two editor conditions. But this is for other issues, codebases and model. You would want to determine if your LM makes errors which such a check would highlight, and if there are other means of finding out.
You would select some issues, and determine how you would assess if the change was acceptable, ideally before starting. You would keep constant the model, initial prompts, range of other commands and method of applying and testing the final change. You would allow the same maximum amount of time, cost, actions, and note how much was actually used. If the syntax check resulted in messages to the LM, you would allow these. Introducing other changes, such as a more effective means of searching, would obscure the reason for any improved result. You would want to keep all changes attempted per issue and pass-fail result.
You would want to list which issues were affected by the change, as well as overall pass rates. For example, it may solve 2 issues to do with reports (like above) but fail 2 to do with some parsing. So no overall change, but a change in which issues were resolved. Or it may be that most issues in your selection require a similar type of change, and that accounts for an improvement. Looking at individual issues and the associated actions would be informative. With multiple attempts per issue, care is needed to group these appropriately.
It would be interesting to know how many changes solved the issue at the first attempt, compared with after one or more failed tests. Both are counted as a pass, but the latter indicate that a more informative set of responses may allow the issue to be solved sooner. Only retaining the successful set of changes would lose this information.
Equally, you would want to know how long or expensive solving each issue was. A system that solved more issues but took much longer might be desirable for some problems. Or it may solve similar numbers of issues, but much faster, for example, because there were fewer unsuccessful edit attempts. So it is valuable to record time, cost, number of actions as well as pass-fail.
So there is a wide range of information that should accompany any statement of "x% of issues solved by y model". What commands were available to view, alter and otherwise manipulate files; what information was returned to the model; how and when were the final changes assessed. All can have a material effect on the final result.