Microsoft researchers teach AI to read spreadsheets


Getting a generative AI model to understand a spreadsheet can be difficult. To try to solve this problem, Microsoft researchers published a paper on Arxiv on July 12 describing SpreadsheetLLM, a coding framework that enables large language models to “read” spreadsheets.

SpreadsheetLLM could “transform spreadsheet data management and analysis, paving the way for smarter and more efficient user interactions,” the researchers wrote.

An advantage of SpreadsheetLLM for businesses would be to use formulas in spreadsheets without having to learn how to use them by asking the AI ​​model questions in natural language.

Why are spreadsheets a challenge for LLMs?

Spreadsheets pose a challenge to LLM students for several reasons.

  • Spreadsheets can be very large and exceed the number of characters an LLM can process at one time.
  • Spreadsheets are “two-dimensional layouts and structures,” as the report puts it, as opposed to the “linear, sequential input” that LLMs work well with.
  • LLMs are generally not trained to interpret cell addresses and specific spreadsheet formats.

Microsoft researchers used a multi-step technique to analyze spreadsheets

There are two main parts of SpreadsheetLLM:

  • Leaf compressorwhich is a framework for reducing spreadsheets into formats that master's students can understand.
  • Spreadsheet chainwhich is a methodology for teaching an LLM how to identify the correct parts of a compressed spreadsheet to “look at” when presented with a question and to generate an answer.
Diagram of how the SpreadsheetLLM framework “reads” a spreadsheet by performing multiple processes. Image: Microsoft

SheetCompressor has three modules:

  • Structural anchors that help LLMs identify rows and columns in the spreadsheet.
  • A method to reduce the number of tokens it costs the LLM to interpret the spreadsheet.
  • A technique to improve efficiency by grouping similar cells.

Using these modules, the team reduced the tokens required for spreadsheet encoding by 96%. This, in turn, enabled a slight improvement (12.3%) over the work of another leading research team in helping LLMs understand spreadsheets. The researchers tested their spreadsheet identification method with these LLMs:

  • OpenAI's GPT-4 and GPT-3.5.
  • Call 2 and Call 3 of Meta.
  • Microsoft Phi-3.
  • Mistral AI's Mistral-v2.

For the spreadsheet's capability chain, they used GPT-4.

What does SpreadsheetLLM mean for Microsoft’s AI efforts?

The obvious advantage for Microsoft here is that it allows its Copilot AI assistant, which runs across many apps in the Microsoft 365 suite, to do more things in Excel. SpreadsheetLLM represents the ongoing effort to make generative AI practical, and opening up Excel to people who haven’t been trained on its more advanced features could be a good niche for generative AI to expand into.

SEE: To what extent does your company engage with Microsoft Copilot will affect which version (if any) is right for your job.

Real-world usage and next steps for this Microsoft research

For now, a 12.3% improvement over the findings of a previous lead research team is more academically significant than economically. Generative AI is famous for making stuff up, and hallucinations cascading through a spreadsheet could render huge amounts of data useless. As the researchers note, getting an LLM to understand the format of a spreadsheet (i.e., what a spreadsheet typically looks like and how it works) is different from getting the LLM to generate comprehensible and accurate data within those cells.

Furthermore, this methodology requires a lot of computing power and multiple passes through an LLM to generate an answer. Also, your office Excel wizard might be able to generate an answer in a few minutes without using much power.

In the future, the research team wants to include a way to encode details such as the background color of cells and deepen LLMs' understanding of how words within cells relate to each other.

TechRepublic has reached out to Microsoft for further comment.

scroll to top