<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>[2407.09025] SpreadsheetLLM: Encoding Spreadsheets for Large Language Models</title><meta property="og:description" content="Spreadsheets are characterized by their extensive two-dimensional grids, flexible layouts, and varied formatting options, which pose significant challenges for large language models (LLMs). In response, we introduce Sp…">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SpreadsheetLLM: Encoding Spreadsheets for Large Language Models">
<meta name="twitter:image:src" content="https://ar5iv.labs.arxiv.org/assets/ar5iv_card.png">
<meta name="twitter:image:alt" content="ar5iv logo">
<meta property="og:title" content="SpreadsheetLLM: Encoding Spreadsheets for Large Language Models">
<meta property="og:site_name" content="ar5iv">
<meta property="og:image" content="https://ar5iv.labs.arxiv.org/assets/ar5iv_card.png">
<meta property="og:type" content="article">
<meta property="og:url" content="https://ar5iv.labs.arxiv.org/html/2407.09025">

<!--Generated on Mon Aug  5 16:17:05 2024 by LaTeXML (version 0.8.8) http://dlmf.nist.gov/LaTeXML/.-->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<script>
  function detectColorScheme(){
    var theme="light";
    var current_theme = localStorage.getItem("ar5iv_theme");
    if(current_theme){
      if(current_theme == "dark"){
        theme = "dark";
      } }
    else if(!window.matchMedia) { return false; }
    else if(window.matchMedia("(prefers-color-scheme: dark)").matches) {
      theme = "dark"; }
    if (theme=="dark") {
      document.documentElement.setAttribute("data-theme", "dark");
    } else {
      document.documentElement.setAttribute("data-theme", "light"); } }

  detectColorScheme();

  function toggleColorScheme(){
    var current_theme = localStorage.getItem("ar5iv_theme");
    if (current_theme) {
      if (current_theme == "light") {
        localStorage.setItem("ar5iv_theme", "dark"); }
      else {
        localStorage.setItem("ar5iv_theme", "light"); } }
    else {
        localStorage.setItem("ar5iv_theme", "dark"); }
    detectColorScheme(); }
</script>
<link media="all" rel="stylesheet" href="/assets/ar5iv-fonts.0.7.9.min.css"><link media="all" rel="stylesheet" href="/assets/ar5iv.0.7.9.min.css"><link media="all" rel="stylesheet" href="/assets/ar5iv-site.0.2.2.css">
</head>
<body>
<div class="ltx_page_main">
<div class="ltx_page_content">
<article class="ltx_document">
<h1 class="ltx_title ltx_title_document">
<span id="id1.id1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>: Encoding Spreadsheets for Large Language Models</h1>
<div class="ltx_authors">
<span class="ltx_creator ltx_role_author">
<span class="ltx_personname">
Yuzhang Tian,
Jianbo Zhao<span id="footnotex1" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">1</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">1</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note">1</span></span></span></span><span id="footnotex2" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">2</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">2</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note">2</span></span></span></span>,
Haoyu Dong,
Junyu Xiong<sup id="id2.1.id1" class="ltx_sup">†</sup>,
Shiyu Xia<sup id="id3.2.id2" class="ltx_sup">†</sup>,

<br class="ltx_break"><span id="id4.3.id3" class="ltx_text ltx_font_bold">Mengyu Zhou,
Yun Lin<span id="footnotex3" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">2</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">2</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note"><span id="footnotex3.1.1.1" class="ltx_text ltx_font_medium">2</span></span></span></span></span>,
José Cambronero,
Yeye He,
Shi Han,
Dongmei Zhang</span>

<br class="ltx_break">Microsoft Corporation
</span><span class="ltx_author_notes">  Equal contribution.  Work during internship at Microsoft.  Corresponding author.</span></span>
</div>

<div class="ltx_abstract">
<h6 class="ltx_title ltx_title_abstract">Abstract</h6>
<p id="id5.id1" class="ltx_p">Spreadsheets are characterized by their extensive two-dimensional grids, flexible layouts, and varied formatting options, which pose significant challenges for large language models (LLMs). In response, we introduce <span id="id5.id1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>, pioneering an efficient encoding method designed to unleash and optimize LLMs’ powerful understanding and reasoning capability on spreadsheets. Initially, we propose a vanilla serialization approach that incorporates cell addresses, values, and formats. However, this approach was limited by LLMs’ token constraints, making it impractical for most applications. To tackle this challenge, we develop <span id="id5.id1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span>, an innovative encoding framework that compresses spreadsheets effectively for LLMs. It comprises three modules: structural-anchor-based compression, inverse index translation, and data-format-aware aggregation. It significantly improves performance in spreadsheet table detection task, outperforming the vanilla approach by 25.6% in GPT4’s in-context learning setting. Moreover, fine-tuned LLM with <span id="id5.id1.3" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> has an average compression ratio of 25×, but achieves a state-of-the-art 78.9% F1 score, surpassing the best existing models by 12.3%.
Finally, we propose Chain of Spreadsheet for downstream tasks of spreadsheet understanding and validate in a new and demanding spreadsheet QA task. We methodically leverage the inherent layout and structure of spreadsheets, demonstrating that <span id="id5.id1.4" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> is highly effective across a variety of spreadsheet tasks.</p>
</div>
<div id="p1" class="ltx_para ltx_noindent">
<div id="p1.1" class="ltx_block ltx_align_bottom">
<p id="p1.1.1" class="ltx_p"><span id="p1.1.1.1" class="ltx_text ltx_font_bold ltx_font_smallcaps">SpreadsheetLLM<span id="p1.1.1.1.1" class="ltx_text ltx_font_upright">: Encoding Spreadsheets for Large Language Models</span></span></p>
<br class="ltx_break ltx_centering">
<p id="p1.1.2" class="ltx_p ltx_align_center" style="width:433.6pt;"><span id="p1.1.2.1" class="ltx_text ltx_inline-block" style="width:0.0pt;">
<span id="p1.1.2.1.1" class="ltx_tabular ltx_align_top">
<span class="ltx_tbody">
<span id="p1.1.2.1.1.1.1" class="ltx_tr">
<span id="p1.1.2.1.1.1.1.1" class="ltx_td ltx_align_center"><span id="p1.1.2.1.1.1.1.1.1" class="ltx_text ltx_font_bold">
Yuzhang Tian<span id="p1.1.2.1.1.1.1.1.1.1" class="ltx_note ltx_role_thanks"><sup class="ltx_note_mark">†</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">†</sup><span class="ltx_note_type">thanks: </span>  Equal contribution.</span></span></span><span id="p1.1.2.1.1.1.1.1.1.2" class="ltx_note ltx_role_thanks"><sup class="ltx_note_mark">†</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">†</sup><span class="ltx_note_type">thanks: </span>  Work during internship at Microsoft.</span></span></span>,
Jianbo Zhao<span id="footnotex4" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">1</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">1</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note"><span id="footnotex4.1.1.1" class="ltx_text ltx_font_medium">1</span></span></span></span></span><span id="footnotex5" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">2</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">2</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note"><span id="footnotex5.1.1.1" class="ltx_text ltx_font_medium">2</span></span></span></span></span>,
Haoyu Dong<span id="p1.1.2.1.1.1.1.1.1.3" class="ltx_note ltx_role_thanks"><sup class="ltx_note_mark">†</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">†</sup><span class="ltx_note_type">thanks: </span>  Corresponding author.</span></span></span>,
Junyu Xiong<sup id="p1.1.2.1.1.1.1.1.1.4" class="ltx_sup">†</sup>,
Shiyu Xia<sup id="p1.1.2.1.1.1.1.1.1.5" class="ltx_sup">†</sup>,</span></span></span>
<span id="p1.1.2.1.1.2.2" class="ltx_tr">
<span id="p1.1.2.1.1.2.2.1" class="ltx_td ltx_align_center"><span id="p1.1.2.1.1.2.2.1.1" class="ltx_text ltx_font_bold">Mengyu Zhou,
Yun Lin<span id="footnotex6" class="ltx_note ltx_role_footnotemark"><sup class="ltx_note_mark">2</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">2</sup><span class="ltx_note_type">footnotemark: </span><span class="ltx_tag ltx_tag_note"><span id="footnotex6.1.1.1" class="ltx_text ltx_font_medium">2</span></span></span></span></span>,
José Cambronero,
Yeye He,
Shi Han,
Dongmei Zhang</span></span></span>
<span id="p1.1.2.1.1.3.3" class="ltx_tr">
<span id="p1.1.2.1.1.3.3.1" class="ltx_td ltx_align_center">Microsoft Corporation</span></span>
</span>
</span></span></p>
<br class="ltx_break ltx_centering">
</div>
</div>
<figure id="S0.F1" class="ltx_figure"><img src="/html/2407.09025/assets/fig/overview.png" id="S0.F1.g1" class="ltx_graphics ltx_img_landscape" width="269" height="184" alt="Refer to caption">
<figcaption class="ltx_caption"><span class="ltx_tag ltx_tag_figure">Figure 1: </span>The <span id="S0.F1.2.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> pipeline.</figcaption>
</figure>
<section id="S1" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">1 </span>Introduction</h2>

<div id="S1.p1" class="ltx_para">
<p id="S1.p1.1" class="ltx_p">Spreadsheets are ubiquitous for data management and extensively utilized within platforms like Microsoft Excel and Google Sheets. Understanding spreadsheet layout and structure <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>); Gol et al. (<a href="#bib.bib17" title="" class="ltx_ref">2019</a>); Hulsebos et al. (<a href="#bib.bib20" title="" class="ltx_ref">2019</a>); Dou et al. (<a href="#bib.bib14" title="" class="ltx_ref">2018</a>); Wang et al. (<a href="#bib.bib37" title="" class="ltx_ref">2021</a>); Deng et al. (<a href="#bib.bib10" title="" class="ltx_ref">2022</a>); Chen and Cafarella (<a href="#bib.bib4" title="" class="ltx_ref">2014</a>)</cite>, a longstanding challenge for traditional models, is crucial for effective data analysis and intelligent user interaction. Recently, the rapid development of Large Language Models (LLMs) has opened new frontiers in table processing <cite class="ltx_cite ltx_citemacro_cite">Li et al. (<a href="#bib.bib27" title="" class="ltx_ref">2023b</a>)</cite> and reasoning <cite class="ltx_cite ltx_citemacro_cite">Cheng et al. (<a href="#bib.bib7" title="" class="ltx_ref">2022</a>)</cite>. However, spreadsheets pose unique challenges for LLMs due to their expansive grids that usually exceed the token limitations of popular LLMs, as well as their inherent two-dimensional layouts and structures, which are poorly suited to linear and sequential input. Furthermore, LLMs often struggle with spreadsheet-specific features such as cell addresses and formats, complicating their ability to effectively parse and utilize spreadsheet data, as detailed in Appendix <a href="#A1" title="Appendix A GPT4 Struggles to Understand Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">A</span></a>.</p>
</div>
<div id="S1.p2" class="ltx_para">
<p id="S1.p2.1" class="ltx_p">In this paper, we introduce <span id="S1.p2.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>, a pioneering framework to unleash and maximize the potential of LLMs for spreadsheet understanding and reasoning.
We initially propose a vanilla encoding method to serialize spreadsheets into sequences, augmenting the Markdown encoding method by including essential cell addresses and (optional) formats.
Furthermore, large spreadsheets that exceed the token limits of LLMs not only limit their processing but also, as observed in prior studies, degrade accuracy performance as the size increases <cite class="ltx_cite ltx_citemacro_cite">Liu et al. (<a href="#bib.bib29" title="" class="ltx_ref">2024</a>)</cite>. To address this challenge, we propose <span id="S1.p2.1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span>, featuring a novel encoding framework comprising three portable modules:</p>
</div>
<div id="S1.p3" class="ltx_para">
<p id="S1.p3.1" class="ltx_p"><span id="S1.p3.1.1" class="ltx_text ltx_font_bold">1) Structural Anchors for Efficient Layout Understanding:</span> Observations indicate that large spreadsheets often contain numerous homogeneous rows or columns, which contribute minimally to understanding the layout and structure (see left panel in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (a)). To address this, we identify structural anchors—heterogeneous rows and columns at possible table boundaries that offer substantial layout insights, as depicted in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (b). Then we remove distant, homogeneous rows and columns, producing a condensed "skeleton" version of the spreadsheet, as illustrated in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (c).</p>
</div>
<div id="S1.p4" class="ltx_para">
<p id="S1.p4.1" class="ltx_p"><span id="S1.p4.1.1" class="ltx_text ltx_font_bold">2) Inverted-Index Translation for Token Efficiency:</span> The vanilla encoding method becomes token-consuming when handling spreadsheets with numerous empty cells and repetitive values, as shown in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (c). To improve efficiency, we depart from traditional row-by-row and column-by-column serialization and employ a lossless inverted-index translation in JSON format. This method creates a dictionary that indexes non-empty cell texts and merges addresses with identical text, optimizing token usage while preserving data integrity.</p>
</div>
<div id="S1.p5" class="ltx_para">
<p id="S1.p5.1" class="ltx_p"><span id="S1.p5.1.1" class="ltx_text ltx_font_bold">3) Data Format Aggregation for Numerical Cells:</span> Adjacent numerical cells often share similar number formats. Recognizing that exact numerical values are less crucial for grasping spreadsheet structure, we extract number format strings and data types from these cells. Then adjacent cells with the same formats or types are clustered together. This method is visualized in the right example of Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a>, where rectangular regions are represented by uniform format strings and data types, streamlining the understanding of numerical data distribution without excessive token expenditure.</p>
</div>
<div id="S1.p6" class="ltx_para">
<p id="S1.p6.1" class="ltx_p">We conducted a comprehensive evaluation of our method on a variety of LLMs. Our experiments show that <span id="S1.p6.1.1" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> significantly reduces token usage for spreadsheet encoding by 96%. Moreover, <span id="S1.p6.1.2" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> has shown exceptional performance in spreadsheet table detection, the foundational task of spreadsheet understanding, surpassing the previous SOTA method by 12.3% <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>)</cite>. We also applied <span id="S1.p6.1.3" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> to a representative spreadsheet QA task. Inspired by the Chain of Thought (CoT) methodology <cite class="ltx_cite ltx_citemacro_cite">Zheng et al. (<a href="#bib.bib42" title="" class="ltx_ref">2023</a>); Jiang et al. (<a href="#bib.bib22" title="" class="ltx_ref">2023b</a>)</cite>, we propose Chain of Spreadsheet (CoS) to decompose spreadsheet reasoning into a table detection-match-reasoning pipeline. It significantly outperformed existing SOTA methods for table QA <cite class="ltx_cite ltx_citemacro_cite">Herzig et al. (<a href="#bib.bib19" title="" class="ltx_ref">2020</a>); Cheng et al. (<a href="#bib.bib7" title="" class="ltx_ref">2022</a>)</cite>.
Our primary contributions are summarized as follows:</p>
<ul id="S1.I1" class="ltx_itemize">
<li id="S1.I1.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_item">•</span> 
<div id="S1.I1.i1.p1" class="ltx_para">
<p id="S1.I1.i1.p1.1" class="ltx_p">We propose <span id="S1.I1.i1.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>, the first work that substantially leverage
LLMs for understanding and analyzing spreadsheet data. To address challenges in scale, diversity, and complexity of spreadsheets, we propose <span id="S1.I1.i1.p1.1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span>, an innovative encoding framework to compress spreadsheets for LLMs with efficient encoding.</p>
</div>
</li>
<li id="S1.I1.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_item">•</span> 
<div id="S1.I1.i2.p1" class="ltx_para">
<p id="S1.I1.i2.p1.1" class="ltx_p">We fine-tune a variety of cutting-edge LLMs to achieve optimal performance on spreadsheet table detection, and demonstrate the high effectiveness of <span id="S1.I1.i2.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> in accurately understanding complex spreadsheet layouts and structures.</p>
</div>
</li>
<li id="S1.I1.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_item">•</span> 
<div id="S1.I1.i3.p1" class="ltx_para">
<p id="S1.I1.i3.p1.1" class="ltx_p">In order to extend the horizontal capabilities of <span id="S1.I1.i3.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> to a wide range of downstream tasks, we propose CoS and verify it on Spreadsheet QA, highlighting its potential for intelligent user interaction.</p>
</div>
</li>
</ul>
</div>
<figure id="S1.F2" class="ltx_figure"><img src="/html/2407.09025/assets/x1.png" id="S1.F2.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="461" height="203" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 2: </span>Illustration of the <span id="S1.F2.2.1" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> framework. The original spreadsheet contains two tables, featuring numerous data entries or hierarchical headers, which can be viewed in the supplementary materials. The completed spreadsheet consists of 576 rows and 23 columns, with an vanilla encoding of 61,240 tokens. Initially, we first extract cells using structural anchors, rearranging them into a smaller 24×8 sheet. Subsequently, we perform index-invert, removing empty cells. Finally, we aggregate cells based one data formats, achieving an extremely compact representation of the spreadsheet, which contains only 708 tokens.</figcaption>
</figure>
</section>
<section id="S2" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">2 </span>Related Work</h2>

<section id="S2.SS0.SSS0.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Spreadsheet Representation</h5>

<div id="S2.SS0.SSS0.Px1.p1" class="ltx_para">
<p id="S2.SS0.SSS0.Px1.p1.1" class="ltx_p">Spreadsheet representation involves converting the spreadsheets into specific representations for different models. There are various methods for spreadsheet (table) representation. <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib12" title="" class="ltx_ref">2019a</a>, <a href="#bib.bib13" title="" class="ltx_ref">b</a>)</cite> enhance Mask-RCNN to leverage spatial and visual information in spreadsheets, and <cite class="ltx_cite ltx_citemacro_cite">Deng et al. (<a href="#bib.bib9" title="" class="ltx_ref">2024</a>)</cite> explores the usage of LLMs to evaluate image tables, but it doesn’t work well for spreadsheet images as input to VLMs <cite class="ltx_cite ltx_citemacro_cite">Xia et al. (<a href="#bib.bib38" title="" class="ltx_ref">2024</a>)</cite>. To capture sequential semantics in rows and columns, LSTMs are further adopted <cite class="ltx_cite ltx_citemacro_cite">Nishida et al. (<a href="#bib.bib30" title="" class="ltx_ref">2017</a>); Gol et al. (<a href="#bib.bib17" title="" class="ltx_ref">2019</a>)</cite> in row&amp;column directions. Pre-trained LMs <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib11" title="" class="ltx_ref">2022</a>)</cite> are then proposed to understand spreadsheets <cite class="ltx_cite ltx_citemacro_cite">Wang et al. (<a href="#bib.bib37" title="" class="ltx_ref">2021</a>)</cite>. Recent studies <cite class="ltx_cite ltx_citemacro_cite">Zhang et al. (<a href="#bib.bib40" title="" class="ltx_ref">2023</a>); Li et al. (<a href="#bib.bib27" title="" class="ltx_ref">2023b</a>); Sui et al. (<a href="#bib.bib32" title="" class="ltx_ref">2023</a>)</cite> have explored the efficacy of using Markdown and HTML for table representation. However, they are not well suited to spreadsheets due to their single table input, as experiments show in Appendix <a href="#A2" title="Appendix B Traditional Encoding Methods for Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">B</span></a>.</p>
</div>
</section>
<section id="S2.SS0.SSS0.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Spreadsheet Understanding</h5>

<div id="S2.SS0.SSS0.Px2.p1" class="ltx_para">
<p id="S2.SS0.SSS0.Px2.p1.1" class="ltx_p">While most table LLMs are restricted to single table settings, spreadsheets with multiple tables typically exceed token limits. Moreover, the diversity in multi-table layout and structure significantly confounds the problem. Spreadsheet table detection <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>); Christodoulakis et al. (<a href="#bib.bib8" title="" class="ltx_ref">2020</a>); Doush and Pontelli (<a href="#bib.bib16" title="" class="ltx_ref">2010</a>); Vitagliano et al. (<a href="#bib.bib34" title="" class="ltx_ref">2022</a>)</cite> aims at identifying all tables on a given sheet and determining their respective ranges. As a fundamental task for spreadsheet understanding, this task triggers hundreds of millions of daily average usage in commercial spreadsheet tools <cite class="ltx_cite ltx_citemacro_cite">Zhang et al. (<a href="#bib.bib41" title="" class="ltx_ref">2024</a>)</cite>, and the accuracy still urges improvements due to the flexibility and complexity of spreadsheets.</p>
</div>
</section>
<section id="S2.SS0.SSS0.Px3" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Spreadsheet Downstream Tasks</h5>

<div id="S2.SS0.SSS0.Px3.p1" class="ltx_para">
<p id="S2.SS0.SSS0.Px3.p1.1" class="ltx_p">Spreadsheet understanding is enabling for a series of spreadsheet tasks, such as table question answering analysis <cite class="ltx_cite ltx_citemacro_cite">He et al. (<a href="#bib.bib18" title="" class="ltx_ref">2024</a>); Cheng et al. (<a href="#bib.bib6" title="" class="ltx_ref">2021b</a>, <a href="#bib.bib7" title="" class="ltx_ref">2022</a>); Jiang et al. (<a href="#bib.bib23" title="" class="ltx_ref">2022</a>); Herzig et al. (<a href="#bib.bib19" title="" class="ltx_ref">2020</a>)</cite>, table extraction <cite class="ltx_cite ltx_citemacro_cite">Chen and Cafarella (<a href="#bib.bib3" title="" class="ltx_ref">2013</a>, <a href="#bib.bib4" title="" class="ltx_ref">2014</a>); Li et al. (<a href="#bib.bib26" title="" class="ltx_ref">2024</a>)</cite>, formula or code generation <cite class="ltx_cite ltx_citemacro_cite">Chen et al. (<a href="#bib.bib2" title="" class="ltx_ref">2021</a>); Cheng et al. (<a href="#bib.bib5" title="" class="ltx_ref">2021a</a>); Joshi et al. (<a href="#bib.bib24" title="" class="ltx_ref">2024</a>); Chen et al. (<a href="#bib.bib1" title="" class="ltx_ref">2024</a>); Li et al. (<a href="#bib.bib25" title="" class="ltx_ref">2023a</a>)</cite>, error detection <cite class="ltx_cite ltx_citemacro_cite">Wang and He (<a href="#bib.bib35" title="" class="ltx_ref">2019</a>); Dou et al. (<a href="#bib.bib15" title="" class="ltx_ref">2016</a>)</cite>, etc. In this paper, we choose spreadsheet QA, one of the most demanded spreadsheet analysis tasks. It is an extension of the Table QA task in spreadsheet data, with the additional complexity of detecting and matching multiple tables within a spreadsheet.</p>
</div>
</section>
<section id="S2.SS0.SSS0.Px4" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">LLMs’ Token Efficiency</h5>

<div id="S2.SS0.SSS0.Px4.p1" class="ltx_para">
<p id="S2.SS0.SSS0.Px4.p1.1" class="ltx_p">Related work suggests that the performance of LLMs degrades significantly with long contexts <cite class="ltx_cite ltx_citemacro_cite">Liu et al. (<a href="#bib.bib29" title="" class="ltx_ref">2024</a>); Xu et al. (<a href="#bib.bib39" title="" class="ltx_ref">2023</a>)</cite>. Efforts to improve model performance and reduce costs have led to the development of compression techniques for long prompts. Some researchers employ information-theory metrics to filter out redundant information <cite class="ltx_cite ltx_citemacro_cite">Li (<a href="#bib.bib28" title="" class="ltx_ref">2023</a>); Jiang et al. (<a href="#bib.bib21" title="" class="ltx_ref">2023a</a>)</cite>. Additionally, specialized models have been proposed to optimize prompt compression <cite class="ltx_cite ltx_citemacro_cite">Pan et al. (<a href="#bib.bib31" title="" class="ltx_ref">2024</a>)</cite>. However, these strategies primarily address natural language prompts and may not suit tabular data, potentially leading to considerable structure and data information loss. DBCopilot <cite class="ltx_cite ltx_citemacro_cite">Wang et al. (<a href="#bib.bib36" title="" class="ltx_ref">2023</a>)</cite> enables text-to-SQL conversion on large databases through schema routing. However, due to LLMs’ insufficient ability in understanding inherent multi-table layouts and complex table structures that cannot execute queries similar to SQL, schema routing is impractical, restricting the broader application of cutting-edge tabular works <cite class="ltx_cite ltx_citemacro_cite">Cheng et al. (<a href="#bib.bib7" title="" class="ltx_ref">2022</a>); Li et al. (<a href="#bib.bib27" title="" class="ltx_ref">2023b</a>); Sui et al. (<a href="#bib.bib33" title="" class="ltx_ref">2024</a>)</cite> on spreadsheet data.</p>
</div>
</section>
</section>
<section id="S3" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">3 </span>Method</h2>

<div id="S3.p1" class="ltx_para">
<p id="S3.p1.1" class="ltx_p">We propose a novel spreadsheet encoding framework in a Markdown-like style as text. To achieve a more compact and efficient representation, we introduce three independent yet combinable modules: structural-anchor-based extraction, inverted-index translation, and data-format-aware aggregation, which enable efficient data compression and enhance performance on downstream tasks.</p>
</div>
<section id="S3.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">3.1 </span>Vanilla Spreadsheet Encoding with Cell Value, Address, and Format</h3>

<div id="S3.SS1.p1" class="ltx_para">
<p id="S3.SS1.p1.8" class="ltx_p">Due to the absence of standardized practices in spreadsheet encoding for LLMs, we first explore traditional spreadsheet encoding methods. Appendix <a href="#A2" title="Appendix B Traditional Encoding Methods for Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">B</span></a> presents a comparison of different mainstream tabular data encoding methods, including HTML, XML, and Markdown. Based on the encoding length and performance on spreadsheet understanding tasks, we use a Markdown-like style representation:</p>
<table id="A13.EGx1" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex1"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex1.m1.5" class="ltx_Math" alttext="\displaystyle\mathcal{S}=\{Cell_{i,j}\}_{i\in m,j\in n}," display="inline"><semantics id="S3.Ex1.m1.5a"><mrow id="S3.Ex1.m1.5.5.1" xref="S3.Ex1.m1.5.5.1.1.cmml"><mrow id="S3.Ex1.m1.5.5.1.1" xref="S3.Ex1.m1.5.5.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex1.m1.5.5.1.1.3" xref="S3.Ex1.m1.5.5.1.1.3.cmml">𝒮</mi><mo id="S3.Ex1.m1.5.5.1.1.2" xref="S3.Ex1.m1.5.5.1.1.2.cmml">=</mo><msub id="S3.Ex1.m1.5.5.1.1.1" xref="S3.Ex1.m1.5.5.1.1.1.cmml"><mrow id="S3.Ex1.m1.5.5.1.1.1.1.1" xref="S3.Ex1.m1.5.5.1.1.1.1.2.cmml"><mo stretchy="false" id="S3.Ex1.m1.5.5.1.1.1.1.1.2" xref="S3.Ex1.m1.5.5.1.1.1.1.2.cmml">{</mo><mrow id="S3.Ex1.m1.5.5.1.1.1.1.1.1" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.cmml"><mi id="S3.Ex1.m1.5.5.1.1.1.1.1.1.2" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.Ex1.m1.5.5.1.1.1.1.1.1.1" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex1.m1.5.5.1.1.1.1.1.1.3" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex1.m1.5.5.1.1.1.1.1.1.1a" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex1.m1.5.5.1.1.1.1.1.1.4" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.Ex1.m1.5.5.1.1.1.1.1.1.1b" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.1.cmml">​</mo><msub id="S3.Ex1.m1.5.5.1.1.1.1.1.1.5" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.cmml"><mi id="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.2" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.Ex1.m1.2.2.2.4" xref="S3.Ex1.m1.2.2.2.3.cmml"><mi id="S3.Ex1.m1.1.1.1.1" xref="S3.Ex1.m1.1.1.1.1.cmml">i</mi><mo id="S3.Ex1.m1.2.2.2.4.1" xref="S3.Ex1.m1.2.2.2.3.cmml">,</mo><mi id="S3.Ex1.m1.2.2.2.2" xref="S3.Ex1.m1.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo stretchy="false" id="S3.Ex1.m1.5.5.1.1.1.1.1.3" xref="S3.Ex1.m1.5.5.1.1.1.1.2.cmml">}</mo></mrow><mrow id="S3.Ex1.m1.4.4.2.2" xref="S3.Ex1.m1.4.4.2.3.cmml"><mrow id="S3.Ex1.m1.3.3.1.1.1" xref="S3.Ex1.m1.3.3.1.1.1.cmml"><mi id="S3.Ex1.m1.3.3.1.1.1.2" xref="S3.Ex1.m1.3.3.1.1.1.2.cmml">i</mi><mo id="S3.Ex1.m1.3.3.1.1.1.1" xref="S3.Ex1.m1.3.3.1.1.1.1.cmml">∈</mo><mi id="S3.Ex1.m1.3.3.1.1.1.3" xref="S3.Ex1.m1.3.3.1.1.1.3.cmml">m</mi></mrow><mo id="S3.Ex1.m1.4.4.2.2.3" xref="S3.Ex1.m1.4.4.2.3a.cmml">,</mo><mrow id="S3.Ex1.m1.4.4.2.2.2" xref="S3.Ex1.m1.4.4.2.2.2.cmml"><mi id="S3.Ex1.m1.4.4.2.2.2.2" xref="S3.Ex1.m1.4.4.2.2.2.2.cmml">j</mi><mo id="S3.Ex1.m1.4.4.2.2.2.1" xref="S3.Ex1.m1.4.4.2.2.2.1.cmml">∈</mo><mi id="S3.Ex1.m1.4.4.2.2.2.3" xref="S3.Ex1.m1.4.4.2.2.2.3.cmml">n</mi></mrow></mrow></msub></mrow><mo id="S3.Ex1.m1.5.5.1.2" xref="S3.Ex1.m1.5.5.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex1.m1.5b"><apply id="S3.Ex1.m1.5.5.1.1.cmml" xref="S3.Ex1.m1.5.5.1"><eq id="S3.Ex1.m1.5.5.1.1.2.cmml" xref="S3.Ex1.m1.5.5.1.1.2"></eq><ci id="S3.Ex1.m1.5.5.1.1.3.cmml" xref="S3.Ex1.m1.5.5.1.1.3">𝒮</ci><apply id="S3.Ex1.m1.5.5.1.1.1.cmml" xref="S3.Ex1.m1.5.5.1.1.1"><csymbol cd="ambiguous" id="S3.Ex1.m1.5.5.1.1.1.2.cmml" xref="S3.Ex1.m1.5.5.1.1.1">subscript</csymbol><set id="S3.Ex1.m1.5.5.1.1.1.1.2.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1"><apply id="S3.Ex1.m1.5.5.1.1.1.1.1.1.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1"><times id="S3.Ex1.m1.5.5.1.1.1.1.1.1.1.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.1"></times><ci id="S3.Ex1.m1.5.5.1.1.1.1.1.1.2.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.2">𝐶</ci><ci id="S3.Ex1.m1.5.5.1.1.1.1.1.1.3.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.3">𝑒</ci><ci id="S3.Ex1.m1.5.5.1.1.1.1.1.1.4.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.4">𝑙</ci><apply id="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.1.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.5">subscript</csymbol><ci id="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.2.cmml" xref="S3.Ex1.m1.5.5.1.1.1.1.1.1.5.2">𝑙</ci><list id="S3.Ex1.m1.2.2.2.3.cmml" xref="S3.Ex1.m1.2.2.2.4"><ci id="S3.Ex1.m1.1.1.1.1.cmml" xref="S3.Ex1.m1.1.1.1.1">𝑖</ci><ci id="S3.Ex1.m1.2.2.2.2.cmml" xref="S3.Ex1.m1.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.Ex1.m1.4.4.2.3.cmml" xref="S3.Ex1.m1.4.4.2.2"><csymbol cd="ambiguous" id="S3.Ex1.m1.4.4.2.3a.cmml" xref="S3.Ex1.m1.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.Ex1.m1.3.3.1.1.1.cmml" xref="S3.Ex1.m1.3.3.1.1.1"><in id="S3.Ex1.m1.3.3.1.1.1.1.cmml" xref="S3.Ex1.m1.3.3.1.1.1.1"></in><ci id="S3.Ex1.m1.3.3.1.1.1.2.cmml" xref="S3.Ex1.m1.3.3.1.1.1.2">𝑖</ci><ci id="S3.Ex1.m1.3.3.1.1.1.3.cmml" xref="S3.Ex1.m1.3.3.1.1.1.3">𝑚</ci></apply><apply id="S3.Ex1.m1.4.4.2.2.2.cmml" xref="S3.Ex1.m1.4.4.2.2.2"><in id="S3.Ex1.m1.4.4.2.2.2.1.cmml" xref="S3.Ex1.m1.4.4.2.2.2.1"></in><ci id="S3.Ex1.m1.4.4.2.2.2.2.cmml" xref="S3.Ex1.m1.4.4.2.2.2.2">𝑗</ci><ci id="S3.Ex1.m1.4.4.2.2.2.3.cmml" xref="S3.Ex1.m1.4.4.2.2.2.3">𝑛</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex1.m1.5c">\displaystyle\mathcal{S}=\{Cell_{i,j}\}_{i\in m,j\in n},</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(1)</span></td>
</tr></tbody>
</table>
<table id="A13.EGx2" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex2"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex2.m1.1" class="ltx_Math" alttext="\displaystyle\mathcal{T}" display="inline"><semantics id="S3.Ex2.m1.1a"><mi class="ltx_font_mathcaligraphic" id="S3.Ex2.m1.1.1" xref="S3.Ex2.m1.1.1.cmml">𝒯</mi><annotation-xml encoding="MathML-Content" id="S3.Ex2.m1.1b"><ci id="S3.Ex2.m1.1.1.cmml" xref="S3.Ex2.m1.1.1">𝒯</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex2.m1.1c">\displaystyle\mathcal{T}</annotation></semantics></math></td>
<td class="ltx_td ltx_align_left ltx_eqn_cell"><math id="S3.Ex2.m2.3" class="ltx_Math" alttext="\displaystyle=\mathrm{markdown}\left\{\mathrm{encode}\left(Cell_{i,j}\right)\right\}" display="inline"><semantics id="S3.Ex2.m2.3a"><mrow id="S3.Ex2.m2.3.3" xref="S3.Ex2.m2.3.3.cmml"><mi id="S3.Ex2.m2.3.3.3" xref="S3.Ex2.m2.3.3.3.cmml"></mi><mo id="S3.Ex2.m2.3.3.2" xref="S3.Ex2.m2.3.3.2.cmml">=</mo><mrow id="S3.Ex2.m2.3.3.1" xref="S3.Ex2.m2.3.3.1.cmml"><mi id="S3.Ex2.m2.3.3.1.3" xref="S3.Ex2.m2.3.3.1.3.cmml">markdown</mi><mo lspace="0em" rspace="0em" id="S3.Ex2.m2.3.3.1.2" xref="S3.Ex2.m2.3.3.1.2.cmml">​</mo><mrow id="S3.Ex2.m2.3.3.1.1.1" xref="S3.Ex2.m2.3.3.1.1.2.cmml"><mo id="S3.Ex2.m2.3.3.1.1.1.2" xref="S3.Ex2.m2.3.3.1.1.2.cmml">{</mo><mrow id="S3.Ex2.m2.3.3.1.1.1.1" xref="S3.Ex2.m2.3.3.1.1.1.1.cmml"><mi id="S3.Ex2.m2.3.3.1.1.1.1.3" xref="S3.Ex2.m2.3.3.1.1.1.1.3.cmml">encode</mi><mo lspace="0em" rspace="0em" id="S3.Ex2.m2.3.3.1.1.1.1.2" xref="S3.Ex2.m2.3.3.1.1.1.1.2.cmml">​</mo><mrow id="S3.Ex2.m2.3.3.1.1.1.1.1.1" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.cmml"><mo id="S3.Ex2.m2.3.3.1.1.1.1.1.1.2" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.cmml">(</mo><mrow id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.cmml"><mi id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.2" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.3" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1a" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.4" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1b" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1.cmml">​</mo><msub id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.cmml"><mi id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.2" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.Ex2.m2.2.2.2.4" xref="S3.Ex2.m2.2.2.2.3.cmml"><mi id="S3.Ex2.m2.1.1.1.1" xref="S3.Ex2.m2.1.1.1.1.cmml">i</mi><mo id="S3.Ex2.m2.2.2.2.4.1" xref="S3.Ex2.m2.2.2.2.3.cmml">,</mo><mi id="S3.Ex2.m2.2.2.2.2" xref="S3.Ex2.m2.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.Ex2.m2.3.3.1.1.1.1.1.1.3" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.cmml">)</mo></mrow></mrow><mo id="S3.Ex2.m2.3.3.1.1.1.3" xref="S3.Ex2.m2.3.3.1.1.2.cmml">}</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex2.m2.3b"><apply id="S3.Ex2.m2.3.3.cmml" xref="S3.Ex2.m2.3.3"><eq id="S3.Ex2.m2.3.3.2.cmml" xref="S3.Ex2.m2.3.3.2"></eq><csymbol cd="latexml" id="S3.Ex2.m2.3.3.3.cmml" xref="S3.Ex2.m2.3.3.3">absent</csymbol><apply id="S3.Ex2.m2.3.3.1.cmml" xref="S3.Ex2.m2.3.3.1"><times id="S3.Ex2.m2.3.3.1.2.cmml" xref="S3.Ex2.m2.3.3.1.2"></times><ci id="S3.Ex2.m2.3.3.1.3.cmml" xref="S3.Ex2.m2.3.3.1.3">markdown</ci><set id="S3.Ex2.m2.3.3.1.1.2.cmml" xref="S3.Ex2.m2.3.3.1.1.1"><apply id="S3.Ex2.m2.3.3.1.1.1.1.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1"><times id="S3.Ex2.m2.3.3.1.1.1.1.2.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.2"></times><ci id="S3.Ex2.m2.3.3.1.1.1.1.3.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.3">encode</ci><apply id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1"><times id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.1"></times><ci id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.2.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.2">𝐶</ci><ci id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.3.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.3">𝑒</ci><ci id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.4.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.4">𝑙</ci><apply id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.1.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5">subscript</csymbol><ci id="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.2.cmml" xref="S3.Ex2.m2.3.3.1.1.1.1.1.1.1.5.2">𝑙</ci><list id="S3.Ex2.m2.2.2.2.3.cmml" xref="S3.Ex2.m2.2.2.2.4"><ci id="S3.Ex2.m2.1.1.1.1.cmml" xref="S3.Ex2.m2.1.1.1.1">𝑖</ci><ci id="S3.Ex2.m2.2.2.2.2.cmml" xref="S3.Ex2.m2.2.2.2.2">𝑗</ci></list></apply></apply></apply></set></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex2.m2.3c">\displaystyle=\mathrm{markdown}\left\{\mathrm{encode}\left(Cell_{i,j}\right)\right\}</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
</tr></tbody>
<tbody id="S3.Ex3"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex3.m1.1" class="ltx_Math" alttext="\displaystyle:" display="inline"><semantics id="S3.Ex3.m1.1a"><mo id="S3.Ex3.m1.1.1" xref="S3.Ex3.m1.1.1.cmml">:</mo><annotation-xml encoding="MathML-Content" id="S3.Ex3.m1.1b"><ci id="S3.Ex3.m1.1.1.cmml" xref="S3.Ex3.m1.1.1">:</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex3.m1.1c">\displaystyle:</annotation></semantics></math></td>
<td class="ltx_td ltx_align_left ltx_eqn_cell"><math id="S3.Ex3.m2.4" class="ltx_math_unparsed" alttext='\displaystyle=``|Address_{i,j},V\!alue_{i,j},F\!ormat|...\setminus\!n",' display="inline"><semantics id="S3.Ex3.m2.4a"><mrow id="S3.Ex3.m2.4b"><mo id="S3.Ex3.m2.4.5">=</mo><mi mathvariant="normal" id="S3.Ex3.m2.4.6">`</mi><mi mathvariant="normal" id="S3.Ex3.m2.4.7">`</mi><mo fence="false" rspace="0.167em" stretchy="false" id="S3.Ex3.m2.4.8">|</mo><mi id="S3.Ex3.m2.4.9">A</mi><mi id="S3.Ex3.m2.4.10">d</mi><mi id="S3.Ex3.m2.4.11">d</mi><mi id="S3.Ex3.m2.4.12">r</mi><mi id="S3.Ex3.m2.4.13">e</mi><mi id="S3.Ex3.m2.4.14">s</mi><msub id="S3.Ex3.m2.4.15"><mi id="S3.Ex3.m2.4.15.2">s</mi><mrow id="S3.Ex3.m2.2.2.2.4"><mi id="S3.Ex3.m2.1.1.1.1">i</mi><mo id="S3.Ex3.m2.2.2.2.4.1">,</mo><mi id="S3.Ex3.m2.2.2.2.2">j</mi></mrow></msub><mo id="S3.Ex3.m2.4.16">,</mo><mpadded width="0.636em" id="S3.Ex3.m2.4c"><mi id="S3.Ex3.m2.4.17">V</mi></mpadded><mi id="S3.Ex3.m2.4.18">a</mi><mi id="S3.Ex3.m2.4.19">l</mi><mi id="S3.Ex3.m2.4.20">u</mi><msub id="S3.Ex3.m2.4.21"><mi id="S3.Ex3.m2.4.21.2">e</mi><mrow id="S3.Ex3.m2.4.4.2.4"><mi id="S3.Ex3.m2.3.3.1.1">i</mi><mo id="S3.Ex3.m2.4.4.2.4.1">,</mo><mi id="S3.Ex3.m2.4.4.2.2">j</mi></mrow></msub><mo id="S3.Ex3.m2.4.22">,</mo><mpadded width="0.612em" id="S3.Ex3.m2.4d"><mi id="S3.Ex3.m2.4.23">F</mi></mpadded><mi id="S3.Ex3.m2.4.24">o</mi><mi id="S3.Ex3.m2.4.25">r</mi><mi id="S3.Ex3.m2.4.26">m</mi><mi id="S3.Ex3.m2.4.27">a</mi><mi id="S3.Ex3.m2.4.28">t</mi><mo fence="false" rspace="0.167em" stretchy="false" id="S3.Ex3.m2.4.29">|</mo><mi mathvariant="normal" id="S3.Ex3.m2.4.30">…</mi><mo rspace="0.052em" id="S3.Ex3.m2.4.31">∖</mo><mi id="S3.Ex3.m2.4.32">n</mi><mi mathvariant="normal" id="S3.Ex3.m2.4.33">"</mi><mo id="S3.Ex3.m2.4.34">,</mo></mrow><annotation encoding="application/x-tex" id="S3.Ex3.m2.4e">\displaystyle=``|Address_{i,j},V\!alue_{i,j},F\!ormat|...\setminus\!n",</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(2)</span></td>
</tr></tbody>
</table>
<p id="S3.SS1.p1.7" class="ltx_p">where <math id="S3.SS1.p1.1.m1.2" class="ltx_Math" alttext="\mathcal{S}\in\mathbb{R}^{m,n}" display="inline"><semantics id="S3.SS1.p1.1.m1.2a"><mrow id="S3.SS1.p1.1.m1.2.3" xref="S3.SS1.p1.1.m1.2.3.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.SS1.p1.1.m1.2.3.2" xref="S3.SS1.p1.1.m1.2.3.2.cmml">𝒮</mi><mo id="S3.SS1.p1.1.m1.2.3.1" xref="S3.SS1.p1.1.m1.2.3.1.cmml">∈</mo><msup id="S3.SS1.p1.1.m1.2.3.3" xref="S3.SS1.p1.1.m1.2.3.3.cmml"><mi id="S3.SS1.p1.1.m1.2.3.3.2" xref="S3.SS1.p1.1.m1.2.3.3.2.cmml">ℝ</mi><mrow id="S3.SS1.p1.1.m1.2.2.2.4" xref="S3.SS1.p1.1.m1.2.2.2.3.cmml"><mi id="S3.SS1.p1.1.m1.1.1.1.1" xref="S3.SS1.p1.1.m1.1.1.1.1.cmml">m</mi><mo id="S3.SS1.p1.1.m1.2.2.2.4.1" xref="S3.SS1.p1.1.m1.2.2.2.3.cmml">,</mo><mi id="S3.SS1.p1.1.m1.2.2.2.2" xref="S3.SS1.p1.1.m1.2.2.2.2.cmml">n</mi></mrow></msup></mrow><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.1.m1.2b"><apply id="S3.SS1.p1.1.m1.2.3.cmml" xref="S3.SS1.p1.1.m1.2.3"><in id="S3.SS1.p1.1.m1.2.3.1.cmml" xref="S3.SS1.p1.1.m1.2.3.1"></in><ci id="S3.SS1.p1.1.m1.2.3.2.cmml" xref="S3.SS1.p1.1.m1.2.3.2">𝒮</ci><apply id="S3.SS1.p1.1.m1.2.3.3.cmml" xref="S3.SS1.p1.1.m1.2.3.3"><csymbol cd="ambiguous" id="S3.SS1.p1.1.m1.2.3.3.1.cmml" xref="S3.SS1.p1.1.m1.2.3.3">superscript</csymbol><ci id="S3.SS1.p1.1.m1.2.3.3.2.cmml" xref="S3.SS1.p1.1.m1.2.3.3.2">ℝ</ci><list id="S3.SS1.p1.1.m1.2.2.2.3.cmml" xref="S3.SS1.p1.1.m1.2.2.2.4"><ci id="S3.SS1.p1.1.m1.1.1.1.1.cmml" xref="S3.SS1.p1.1.m1.1.1.1.1">𝑚</ci><ci id="S3.SS1.p1.1.m1.2.2.2.2.cmml" xref="S3.SS1.p1.1.m1.2.2.2.2">𝑛</ci></list></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.1.m1.2c">\mathcal{S}\in\mathbb{R}^{m,n}</annotation></semantics></math> denotes the spreadsheet, <math id="S3.SS1.p1.2.m2.1" class="ltx_Math" alttext="\mathcal{T}\in\mathbb{R}^{1}" display="inline"><semantics id="S3.SS1.p1.2.m2.1a"><mrow id="S3.SS1.p1.2.m2.1.1" xref="S3.SS1.p1.2.m2.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.SS1.p1.2.m2.1.1.2" xref="S3.SS1.p1.2.m2.1.1.2.cmml">𝒯</mi><mo id="S3.SS1.p1.2.m2.1.1.1" xref="S3.SS1.p1.2.m2.1.1.1.cmml">∈</mo><msup id="S3.SS1.p1.2.m2.1.1.3" xref="S3.SS1.p1.2.m2.1.1.3.cmml"><mi id="S3.SS1.p1.2.m2.1.1.3.2" xref="S3.SS1.p1.2.m2.1.1.3.2.cmml">ℝ</mi><mn id="S3.SS1.p1.2.m2.1.1.3.3" xref="S3.SS1.p1.2.m2.1.1.3.3.cmml">1</mn></msup></mrow><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.2.m2.1b"><apply id="S3.SS1.p1.2.m2.1.1.cmml" xref="S3.SS1.p1.2.m2.1.1"><in id="S3.SS1.p1.2.m2.1.1.1.cmml" xref="S3.SS1.p1.2.m2.1.1.1"></in><ci id="S3.SS1.p1.2.m2.1.1.2.cmml" xref="S3.SS1.p1.2.m2.1.1.2">𝒯</ci><apply id="S3.SS1.p1.2.m2.1.1.3.cmml" xref="S3.SS1.p1.2.m2.1.1.3"><csymbol cd="ambiguous" id="S3.SS1.p1.2.m2.1.1.3.1.cmml" xref="S3.SS1.p1.2.m2.1.1.3">superscript</csymbol><ci id="S3.SS1.p1.2.m2.1.1.3.2.cmml" xref="S3.SS1.p1.2.m2.1.1.3.2">ℝ</ci><cn type="integer" id="S3.SS1.p1.2.m2.1.1.3.3.cmml" xref="S3.SS1.p1.2.m2.1.1.3.3">1</cn></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.2.m2.1c">\mathcal{T}\in\mathbb{R}^{1}</annotation></semantics></math> denotes the text representation of a cell, and <math id="S3.SS1.p1.3.m3.1" class="ltx_Math" alttext="i" display="inline"><semantics id="S3.SS1.p1.3.m3.1a"><mi id="S3.SS1.p1.3.m3.1.1" xref="S3.SS1.p1.3.m3.1.1.cmml">i</mi><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.3.m3.1b"><ci id="S3.SS1.p1.3.m3.1.1.cmml" xref="S3.SS1.p1.3.m3.1.1">𝑖</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.3.m3.1c">i</annotation></semantics></math>, <math id="S3.SS1.p1.4.m4.1" class="ltx_Math" alttext="j" display="inline"><semantics id="S3.SS1.p1.4.m4.1a"><mi id="S3.SS1.p1.4.m4.1.1" xref="S3.SS1.p1.4.m4.1.1.cmml">j</mi><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.4.m4.1b"><ci id="S3.SS1.p1.4.m4.1.1.cmml" xref="S3.SS1.p1.4.m4.1.1">𝑗</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.4.m4.1c">j</annotation></semantics></math>, <math id="S3.SS1.p1.5.m5.1" class="ltx_Math" alttext="m" display="inline"><semantics id="S3.SS1.p1.5.m5.1a"><mi id="S3.SS1.p1.5.m5.1.1" xref="S3.SS1.p1.5.m5.1.1.cmml">m</mi><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.5.m5.1b"><ci id="S3.SS1.p1.5.m5.1.1.cmml" xref="S3.SS1.p1.5.m5.1.1">𝑚</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.5.m5.1c">m</annotation></semantics></math>, <math id="S3.SS1.p1.6.m6.1" class="ltx_Math" alttext="n" display="inline"><semantics id="S3.SS1.p1.6.m6.1a"><mi id="S3.SS1.p1.6.m6.1.1" xref="S3.SS1.p1.6.m6.1.1.cmml">n</mi><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.6.m6.1b"><ci id="S3.SS1.p1.6.m6.1.1.cmml" xref="S3.SS1.p1.6.m6.1.1">𝑛</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.6.m6.1c">n</annotation></semantics></math> respectively represent the row and column index of the cell and the row and column range of <math id="S3.SS1.p1.7.m7.1" class="ltx_Math" alttext="\mathcal{S}" display="inline"><semantics id="S3.SS1.p1.7.m7.1a"><mi class="ltx_font_mathcaligraphic" id="S3.SS1.p1.7.m7.1.1" xref="S3.SS1.p1.7.m7.1.1.cmml">𝒮</mi><annotation-xml encoding="MathML-Content" id="S3.SS1.p1.7.m7.1b"><ci id="S3.SS1.p1.7.m7.1.1.cmml" xref="S3.SS1.p1.7.m7.1.1">𝒮</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS1.p1.7.m7.1c">\mathcal{S}</annotation></semantics></math>. We also explored the inclusion of cell format information (such as background color, bold font, borders, etc.) into each cell’s representation. However, these experiments demonstrated that such detailed encoding adversely affects model performance due to rapid token limit exceedance and LLMs’ inadequate capability to process format information effectively, as detailed in Appendix <a href="#A1" title="Appendix A GPT4 Struggles to Understand Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">A</span></a>. We plan to further explore this in future research, focusing on enhancing the model’s ability to understand and utilize format and structural cues.</p>
</div>
</section>
<section id="S3.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">3.2 </span>Structural-anchor-based Extraction</h3>

<div id="S3.SS2.p1" class="ltx_para">
<p id="S3.SS2.p1.1" class="ltx_p">Large spreadsheets often feature numerous homogeneous rows or columns, which minimally contribute to the understanding of their layout and structure, as depicted in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (a). To effectively compress spreadsheets while preserving vital layout and structural information, we propose a novel heuristic-based method, detailed further in Appendix <a href="#A3" title="Appendix C Lightweight Heuristics for Structural-anchor Proposal ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">C</span></a>. This method identifies heterogeneous rows and columns at the edges of table boundaries—termed structural anchors:</p>
</div>
<div id="S3.SS2.p2" class="ltx_para">
<table id="A13.EGx3" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex4"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex4.m1.3" class="ltx_Math" alttext="\displaystyle\mathcal{A}=\left\{r_{p},c_{q}\right\}_{p\in m,q\in n}," display="inline"><semantics id="S3.Ex4.m1.3a"><mrow id="S3.Ex4.m1.3.3.1" xref="S3.Ex4.m1.3.3.1.1.cmml"><mrow id="S3.Ex4.m1.3.3.1.1" xref="S3.Ex4.m1.3.3.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex4.m1.3.3.1.1.4" xref="S3.Ex4.m1.3.3.1.1.4.cmml">𝒜</mi><mo id="S3.Ex4.m1.3.3.1.1.3" xref="S3.Ex4.m1.3.3.1.1.3.cmml">=</mo><msub id="S3.Ex4.m1.3.3.1.1.2" xref="S3.Ex4.m1.3.3.1.1.2.cmml"><mrow id="S3.Ex4.m1.3.3.1.1.2.2.2" xref="S3.Ex4.m1.3.3.1.1.2.2.3.cmml"><mo id="S3.Ex4.m1.3.3.1.1.2.2.2.3" xref="S3.Ex4.m1.3.3.1.1.2.2.3.cmml">{</mo><msub id="S3.Ex4.m1.3.3.1.1.1.1.1.1" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1.cmml"><mi id="S3.Ex4.m1.3.3.1.1.1.1.1.1.2" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1.2.cmml">r</mi><mi id="S3.Ex4.m1.3.3.1.1.1.1.1.1.3" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1.3.cmml">p</mi></msub><mo id="S3.Ex4.m1.3.3.1.1.2.2.2.4" xref="S3.Ex4.m1.3.3.1.1.2.2.3.cmml">,</mo><msub id="S3.Ex4.m1.3.3.1.1.2.2.2.2" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2.cmml"><mi id="S3.Ex4.m1.3.3.1.1.2.2.2.2.2" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2.2.cmml">c</mi><mi id="S3.Ex4.m1.3.3.1.1.2.2.2.2.3" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2.3.cmml">q</mi></msub><mo id="S3.Ex4.m1.3.3.1.1.2.2.2.5" xref="S3.Ex4.m1.3.3.1.1.2.2.3.cmml">}</mo></mrow><mrow id="S3.Ex4.m1.2.2.2.2" xref="S3.Ex4.m1.2.2.2.3.cmml"><mrow id="S3.Ex4.m1.1.1.1.1.1" xref="S3.Ex4.m1.1.1.1.1.1.cmml"><mi id="S3.Ex4.m1.1.1.1.1.1.2" xref="S3.Ex4.m1.1.1.1.1.1.2.cmml">p</mi><mo id="S3.Ex4.m1.1.1.1.1.1.1" xref="S3.Ex4.m1.1.1.1.1.1.1.cmml">∈</mo><mi id="S3.Ex4.m1.1.1.1.1.1.3" xref="S3.Ex4.m1.1.1.1.1.1.3.cmml">m</mi></mrow><mo id="S3.Ex4.m1.2.2.2.2.3" xref="S3.Ex4.m1.2.2.2.3a.cmml">,</mo><mrow id="S3.Ex4.m1.2.2.2.2.2" xref="S3.Ex4.m1.2.2.2.2.2.cmml"><mi id="S3.Ex4.m1.2.2.2.2.2.2" xref="S3.Ex4.m1.2.2.2.2.2.2.cmml">q</mi><mo id="S3.Ex4.m1.2.2.2.2.2.1" xref="S3.Ex4.m1.2.2.2.2.2.1.cmml">∈</mo><mi id="S3.Ex4.m1.2.2.2.2.2.3" xref="S3.Ex4.m1.2.2.2.2.2.3.cmml">n</mi></mrow></mrow></msub></mrow><mo id="S3.Ex4.m1.3.3.1.2" xref="S3.Ex4.m1.3.3.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex4.m1.3b"><apply id="S3.Ex4.m1.3.3.1.1.cmml" xref="S3.Ex4.m1.3.3.1"><eq id="S3.Ex4.m1.3.3.1.1.3.cmml" xref="S3.Ex4.m1.3.3.1.1.3"></eq><ci id="S3.Ex4.m1.3.3.1.1.4.cmml" xref="S3.Ex4.m1.3.3.1.1.4">𝒜</ci><apply id="S3.Ex4.m1.3.3.1.1.2.cmml" xref="S3.Ex4.m1.3.3.1.1.2"><csymbol cd="ambiguous" id="S3.Ex4.m1.3.3.1.1.2.3.cmml" xref="S3.Ex4.m1.3.3.1.1.2">subscript</csymbol><set id="S3.Ex4.m1.3.3.1.1.2.2.3.cmml" xref="S3.Ex4.m1.3.3.1.1.2.2.2"><apply id="S3.Ex4.m1.3.3.1.1.1.1.1.1.cmml" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1"><csymbol cd="ambiguous" id="S3.Ex4.m1.3.3.1.1.1.1.1.1.1.cmml" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1">subscript</csymbol><ci id="S3.Ex4.m1.3.3.1.1.1.1.1.1.2.cmml" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1.2">𝑟</ci><ci id="S3.Ex4.m1.3.3.1.1.1.1.1.1.3.cmml" xref="S3.Ex4.m1.3.3.1.1.1.1.1.1.3">𝑝</ci></apply><apply id="S3.Ex4.m1.3.3.1.1.2.2.2.2.cmml" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2"><csymbol cd="ambiguous" id="S3.Ex4.m1.3.3.1.1.2.2.2.2.1.cmml" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2">subscript</csymbol><ci id="S3.Ex4.m1.3.3.1.1.2.2.2.2.2.cmml" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2.2">𝑐</ci><ci id="S3.Ex4.m1.3.3.1.1.2.2.2.2.3.cmml" xref="S3.Ex4.m1.3.3.1.1.2.2.2.2.3">𝑞</ci></apply></set><apply id="S3.Ex4.m1.2.2.2.3.cmml" xref="S3.Ex4.m1.2.2.2.2"><csymbol cd="ambiguous" id="S3.Ex4.m1.2.2.2.3a.cmml" xref="S3.Ex4.m1.2.2.2.2.3">formulae-sequence</csymbol><apply id="S3.Ex4.m1.1.1.1.1.1.cmml" xref="S3.Ex4.m1.1.1.1.1.1"><in id="S3.Ex4.m1.1.1.1.1.1.1.cmml" xref="S3.Ex4.m1.1.1.1.1.1.1"></in><ci id="S3.Ex4.m1.1.1.1.1.1.2.cmml" xref="S3.Ex4.m1.1.1.1.1.1.2">𝑝</ci><ci id="S3.Ex4.m1.1.1.1.1.1.3.cmml" xref="S3.Ex4.m1.1.1.1.1.1.3">𝑚</ci></apply><apply id="S3.Ex4.m1.2.2.2.2.2.cmml" xref="S3.Ex4.m1.2.2.2.2.2"><in id="S3.Ex4.m1.2.2.2.2.2.1.cmml" xref="S3.Ex4.m1.2.2.2.2.2.1"></in><ci id="S3.Ex4.m1.2.2.2.2.2.2.cmml" xref="S3.Ex4.m1.2.2.2.2.2.2">𝑞</ci><ci id="S3.Ex4.m1.2.2.2.2.2.3.cmml" xref="S3.Ex4.m1.2.2.2.2.2.3">𝑛</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex4.m1.3c">\displaystyle\mathcal{A}=\left\{r_{p},c_{q}\right\}_{p\in m,q\in n},</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(3)</span></td>
</tr></tbody>
</table>
<p id="S3.SS2.p2.5" class="ltx_p">where <math id="S3.SS2.p2.1.m1.5" class="ltx_Math" alttext="r_{p}=\left\{Cell_{i,j}\right\}_{i=p,j\in n}" display="inline"><semantics id="S3.SS2.p2.1.m1.5a"><mrow id="S3.SS2.p2.1.m1.5.5" xref="S3.SS2.p2.1.m1.5.5.cmml"><msub id="S3.SS2.p2.1.m1.5.5.3" xref="S3.SS2.p2.1.m1.5.5.3.cmml"><mi id="S3.SS2.p2.1.m1.5.5.3.2" xref="S3.SS2.p2.1.m1.5.5.3.2.cmml">r</mi><mi id="S3.SS2.p2.1.m1.5.5.3.3" xref="S3.SS2.p2.1.m1.5.5.3.3.cmml">p</mi></msub><mo id="S3.SS2.p2.1.m1.5.5.2" xref="S3.SS2.p2.1.m1.5.5.2.cmml">=</mo><msub id="S3.SS2.p2.1.m1.5.5.1" xref="S3.SS2.p2.1.m1.5.5.1.cmml"><mrow id="S3.SS2.p2.1.m1.5.5.1.1.1" xref="S3.SS2.p2.1.m1.5.5.1.1.2.cmml"><mo id="S3.SS2.p2.1.m1.5.5.1.1.1.2" xref="S3.SS2.p2.1.m1.5.5.1.1.2.cmml">{</mo><mrow id="S3.SS2.p2.1.m1.5.5.1.1.1.1" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.cmml"><mi id="S3.SS2.p2.1.m1.5.5.1.1.1.1.2" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.1.m1.5.5.1.1.1.1.1" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p2.1.m1.5.5.1.1.1.1.3" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.1.m1.5.5.1.1.1.1.1a" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p2.1.m1.5.5.1.1.1.1.4" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.1.m1.5.5.1.1.1.1.1b" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.1.cmml">​</mo><msub id="S3.SS2.p2.1.m1.5.5.1.1.1.1.5" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.cmml"><mi id="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.2" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.SS2.p2.1.m1.2.2.2.4" xref="S3.SS2.p2.1.m1.2.2.2.3.cmml"><mi id="S3.SS2.p2.1.m1.1.1.1.1" xref="S3.SS2.p2.1.m1.1.1.1.1.cmml">i</mi><mo id="S3.SS2.p2.1.m1.2.2.2.4.1" xref="S3.SS2.p2.1.m1.2.2.2.3.cmml">,</mo><mi id="S3.SS2.p2.1.m1.2.2.2.2" xref="S3.SS2.p2.1.m1.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.SS2.p2.1.m1.5.5.1.1.1.3" xref="S3.SS2.p2.1.m1.5.5.1.1.2.cmml">}</mo></mrow><mrow id="S3.SS2.p2.1.m1.4.4.2.2" xref="S3.SS2.p2.1.m1.4.4.2.3.cmml"><mrow id="S3.SS2.p2.1.m1.3.3.1.1.1" xref="S3.SS2.p2.1.m1.3.3.1.1.1.cmml"><mi id="S3.SS2.p2.1.m1.3.3.1.1.1.2" xref="S3.SS2.p2.1.m1.3.3.1.1.1.2.cmml">i</mi><mo id="S3.SS2.p2.1.m1.3.3.1.1.1.1" xref="S3.SS2.p2.1.m1.3.3.1.1.1.1.cmml">=</mo><mi id="S3.SS2.p2.1.m1.3.3.1.1.1.3" xref="S3.SS2.p2.1.m1.3.3.1.1.1.3.cmml">p</mi></mrow><mo id="S3.SS2.p2.1.m1.4.4.2.2.3" xref="S3.SS2.p2.1.m1.4.4.2.3a.cmml">,</mo><mrow id="S3.SS2.p2.1.m1.4.4.2.2.2" xref="S3.SS2.p2.1.m1.4.4.2.2.2.cmml"><mi id="S3.SS2.p2.1.m1.4.4.2.2.2.2" xref="S3.SS2.p2.1.m1.4.4.2.2.2.2.cmml">j</mi><mo id="S3.SS2.p2.1.m1.4.4.2.2.2.1" xref="S3.SS2.p2.1.m1.4.4.2.2.2.1.cmml">∈</mo><mi id="S3.SS2.p2.1.m1.4.4.2.2.2.3" xref="S3.SS2.p2.1.m1.4.4.2.2.2.3.cmml">n</mi></mrow></mrow></msub></mrow><annotation-xml encoding="MathML-Content" id="S3.SS2.p2.1.m1.5b"><apply id="S3.SS2.p2.1.m1.5.5.cmml" xref="S3.SS2.p2.1.m1.5.5"><eq id="S3.SS2.p2.1.m1.5.5.2.cmml" xref="S3.SS2.p2.1.m1.5.5.2"></eq><apply id="S3.SS2.p2.1.m1.5.5.3.cmml" xref="S3.SS2.p2.1.m1.5.5.3"><csymbol cd="ambiguous" id="S3.SS2.p2.1.m1.5.5.3.1.cmml" xref="S3.SS2.p2.1.m1.5.5.3">subscript</csymbol><ci id="S3.SS2.p2.1.m1.5.5.3.2.cmml" xref="S3.SS2.p2.1.m1.5.5.3.2">𝑟</ci><ci id="S3.SS2.p2.1.m1.5.5.3.3.cmml" xref="S3.SS2.p2.1.m1.5.5.3.3">𝑝</ci></apply><apply id="S3.SS2.p2.1.m1.5.5.1.cmml" xref="S3.SS2.p2.1.m1.5.5.1"><csymbol cd="ambiguous" id="S3.SS2.p2.1.m1.5.5.1.2.cmml" xref="S3.SS2.p2.1.m1.5.5.1">subscript</csymbol><set id="S3.SS2.p2.1.m1.5.5.1.1.2.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1"><apply id="S3.SS2.p2.1.m1.5.5.1.1.1.1.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1"><times id="S3.SS2.p2.1.m1.5.5.1.1.1.1.1.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.1"></times><ci id="S3.SS2.p2.1.m1.5.5.1.1.1.1.2.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.2">𝐶</ci><ci id="S3.SS2.p2.1.m1.5.5.1.1.1.1.3.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.3">𝑒</ci><ci id="S3.SS2.p2.1.m1.5.5.1.1.1.1.4.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.4">𝑙</ci><apply id="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.1.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.5">subscript</csymbol><ci id="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.2.cmml" xref="S3.SS2.p2.1.m1.5.5.1.1.1.1.5.2">𝑙</ci><list id="S3.SS2.p2.1.m1.2.2.2.3.cmml" xref="S3.SS2.p2.1.m1.2.2.2.4"><ci id="S3.SS2.p2.1.m1.1.1.1.1.cmml" xref="S3.SS2.p2.1.m1.1.1.1.1">𝑖</ci><ci id="S3.SS2.p2.1.m1.2.2.2.2.cmml" xref="S3.SS2.p2.1.m1.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.SS2.p2.1.m1.4.4.2.3.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2"><csymbol cd="ambiguous" id="S3.SS2.p2.1.m1.4.4.2.3a.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.SS2.p2.1.m1.3.3.1.1.1.cmml" xref="S3.SS2.p2.1.m1.3.3.1.1.1"><eq id="S3.SS2.p2.1.m1.3.3.1.1.1.1.cmml" xref="S3.SS2.p2.1.m1.3.3.1.1.1.1"></eq><ci id="S3.SS2.p2.1.m1.3.3.1.1.1.2.cmml" xref="S3.SS2.p2.1.m1.3.3.1.1.1.2">𝑖</ci><ci id="S3.SS2.p2.1.m1.3.3.1.1.1.3.cmml" xref="S3.SS2.p2.1.m1.3.3.1.1.1.3">𝑝</ci></apply><apply id="S3.SS2.p2.1.m1.4.4.2.2.2.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2.2"><in id="S3.SS2.p2.1.m1.4.4.2.2.2.1.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2.2.1"></in><ci id="S3.SS2.p2.1.m1.4.4.2.2.2.2.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2.2.2">𝑗</ci><ci id="S3.SS2.p2.1.m1.4.4.2.2.2.3.cmml" xref="S3.SS2.p2.1.m1.4.4.2.2.2.3">𝑛</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p2.1.m1.5c">r_{p}=\left\{Cell_{i,j}\right\}_{i=p,j\in n}</annotation></semantics></math> and <math id="S3.SS2.p2.2.m2.5" class="ltx_Math" alttext="c_{q}=\left\{Cell_{i,j}\right\}_{i\in m,j=q}" display="inline"><semantics id="S3.SS2.p2.2.m2.5a"><mrow id="S3.SS2.p2.2.m2.5.5" xref="S3.SS2.p2.2.m2.5.5.cmml"><msub id="S3.SS2.p2.2.m2.5.5.3" xref="S3.SS2.p2.2.m2.5.5.3.cmml"><mi id="S3.SS2.p2.2.m2.5.5.3.2" xref="S3.SS2.p2.2.m2.5.5.3.2.cmml">c</mi><mi id="S3.SS2.p2.2.m2.5.5.3.3" xref="S3.SS2.p2.2.m2.5.5.3.3.cmml">q</mi></msub><mo id="S3.SS2.p2.2.m2.5.5.2" xref="S3.SS2.p2.2.m2.5.5.2.cmml">=</mo><msub id="S3.SS2.p2.2.m2.5.5.1" xref="S3.SS2.p2.2.m2.5.5.1.cmml"><mrow id="S3.SS2.p2.2.m2.5.5.1.1.1" xref="S3.SS2.p2.2.m2.5.5.1.1.2.cmml"><mo id="S3.SS2.p2.2.m2.5.5.1.1.1.2" xref="S3.SS2.p2.2.m2.5.5.1.1.2.cmml">{</mo><mrow id="S3.SS2.p2.2.m2.5.5.1.1.1.1" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.cmml"><mi id="S3.SS2.p2.2.m2.5.5.1.1.1.1.2" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.2.m2.5.5.1.1.1.1.1" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p2.2.m2.5.5.1.1.1.1.3" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.2.m2.5.5.1.1.1.1.1a" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p2.2.m2.5.5.1.1.1.1.4" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p2.2.m2.5.5.1.1.1.1.1b" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.1.cmml">​</mo><msub id="S3.SS2.p2.2.m2.5.5.1.1.1.1.5" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.cmml"><mi id="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.2" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.SS2.p2.2.m2.2.2.2.4" xref="S3.SS2.p2.2.m2.2.2.2.3.cmml"><mi id="S3.SS2.p2.2.m2.1.1.1.1" xref="S3.SS2.p2.2.m2.1.1.1.1.cmml">i</mi><mo id="S3.SS2.p2.2.m2.2.2.2.4.1" xref="S3.SS2.p2.2.m2.2.2.2.3.cmml">,</mo><mi id="S3.SS2.p2.2.m2.2.2.2.2" xref="S3.SS2.p2.2.m2.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.SS2.p2.2.m2.5.5.1.1.1.3" xref="S3.SS2.p2.2.m2.5.5.1.1.2.cmml">}</mo></mrow><mrow id="S3.SS2.p2.2.m2.4.4.2.2" xref="S3.SS2.p2.2.m2.4.4.2.3.cmml"><mrow id="S3.SS2.p2.2.m2.3.3.1.1.1" xref="S3.SS2.p2.2.m2.3.3.1.1.1.cmml"><mi id="S3.SS2.p2.2.m2.3.3.1.1.1.2" xref="S3.SS2.p2.2.m2.3.3.1.1.1.2.cmml">i</mi><mo id="S3.SS2.p2.2.m2.3.3.1.1.1.1" xref="S3.SS2.p2.2.m2.3.3.1.1.1.1.cmml">∈</mo><mi id="S3.SS2.p2.2.m2.3.3.1.1.1.3" xref="S3.SS2.p2.2.m2.3.3.1.1.1.3.cmml">m</mi></mrow><mo id="S3.SS2.p2.2.m2.4.4.2.2.3" xref="S3.SS2.p2.2.m2.4.4.2.3a.cmml">,</mo><mrow id="S3.SS2.p2.2.m2.4.4.2.2.2" xref="S3.SS2.p2.2.m2.4.4.2.2.2.cmml"><mi id="S3.SS2.p2.2.m2.4.4.2.2.2.2" xref="S3.SS2.p2.2.m2.4.4.2.2.2.2.cmml">j</mi><mo id="S3.SS2.p2.2.m2.4.4.2.2.2.1" xref="S3.SS2.p2.2.m2.4.4.2.2.2.1.cmml">=</mo><mi id="S3.SS2.p2.2.m2.4.4.2.2.2.3" xref="S3.SS2.p2.2.m2.4.4.2.2.2.3.cmml">q</mi></mrow></mrow></msub></mrow><annotation-xml encoding="MathML-Content" id="S3.SS2.p2.2.m2.5b"><apply id="S3.SS2.p2.2.m2.5.5.cmml" xref="S3.SS2.p2.2.m2.5.5"><eq id="S3.SS2.p2.2.m2.5.5.2.cmml" xref="S3.SS2.p2.2.m2.5.5.2"></eq><apply id="S3.SS2.p2.2.m2.5.5.3.cmml" xref="S3.SS2.p2.2.m2.5.5.3"><csymbol cd="ambiguous" id="S3.SS2.p2.2.m2.5.5.3.1.cmml" xref="S3.SS2.p2.2.m2.5.5.3">subscript</csymbol><ci id="S3.SS2.p2.2.m2.5.5.3.2.cmml" xref="S3.SS2.p2.2.m2.5.5.3.2">𝑐</ci><ci id="S3.SS2.p2.2.m2.5.5.3.3.cmml" xref="S3.SS2.p2.2.m2.5.5.3.3">𝑞</ci></apply><apply id="S3.SS2.p2.2.m2.5.5.1.cmml" xref="S3.SS2.p2.2.m2.5.5.1"><csymbol cd="ambiguous" id="S3.SS2.p2.2.m2.5.5.1.2.cmml" xref="S3.SS2.p2.2.m2.5.5.1">subscript</csymbol><set id="S3.SS2.p2.2.m2.5.5.1.1.2.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1"><apply id="S3.SS2.p2.2.m2.5.5.1.1.1.1.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1"><times id="S3.SS2.p2.2.m2.5.5.1.1.1.1.1.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.1"></times><ci id="S3.SS2.p2.2.m2.5.5.1.1.1.1.2.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.2">𝐶</ci><ci id="S3.SS2.p2.2.m2.5.5.1.1.1.1.3.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.3">𝑒</ci><ci id="S3.SS2.p2.2.m2.5.5.1.1.1.1.4.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.4">𝑙</ci><apply id="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.1.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.5">subscript</csymbol><ci id="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.2.cmml" xref="S3.SS2.p2.2.m2.5.5.1.1.1.1.5.2">𝑙</ci><list id="S3.SS2.p2.2.m2.2.2.2.3.cmml" xref="S3.SS2.p2.2.m2.2.2.2.4"><ci id="S3.SS2.p2.2.m2.1.1.1.1.cmml" xref="S3.SS2.p2.2.m2.1.1.1.1">𝑖</ci><ci id="S3.SS2.p2.2.m2.2.2.2.2.cmml" xref="S3.SS2.p2.2.m2.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.SS2.p2.2.m2.4.4.2.3.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2"><csymbol cd="ambiguous" id="S3.SS2.p2.2.m2.4.4.2.3a.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.SS2.p2.2.m2.3.3.1.1.1.cmml" xref="S3.SS2.p2.2.m2.3.3.1.1.1"><in id="S3.SS2.p2.2.m2.3.3.1.1.1.1.cmml" xref="S3.SS2.p2.2.m2.3.3.1.1.1.1"></in><ci id="S3.SS2.p2.2.m2.3.3.1.1.1.2.cmml" xref="S3.SS2.p2.2.m2.3.3.1.1.1.2">𝑖</ci><ci id="S3.SS2.p2.2.m2.3.3.1.1.1.3.cmml" xref="S3.SS2.p2.2.m2.3.3.1.1.1.3">𝑚</ci></apply><apply id="S3.SS2.p2.2.m2.4.4.2.2.2.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2.2"><eq id="S3.SS2.p2.2.m2.4.4.2.2.2.1.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2.2.1"></eq><ci id="S3.SS2.p2.2.m2.4.4.2.2.2.2.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2.2.2">𝑗</ci><ci id="S3.SS2.p2.2.m2.4.4.2.2.2.3.cmml" xref="S3.SS2.p2.2.m2.4.4.2.2.2.3">𝑞</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p2.2.m2.5c">c_{q}=\left\{Cell_{i,j}\right\}_{i\in m,j=q}</annotation></semantics></math>.
Using these anchor points, our method discards rows and columns that are located more than <math id="S3.SS2.p2.3.m3.1" class="ltx_Math" alttext="k" display="inline"><semantics id="S3.SS2.p2.3.m3.1a"><mi id="S3.SS2.p2.3.m3.1.1" xref="S3.SS2.p2.3.m3.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="S3.SS2.p2.3.m3.1b"><ci id="S3.SS2.p2.3.m3.1.1.cmml" xref="S3.SS2.p2.3.m3.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p2.3.m3.1c">k</annotation></semantics></math> units away from any anchor point, because they rarely serve as table boundaries. The parameter <math id="S3.SS2.p2.4.m4.1" class="ltx_Math" alttext="k" display="inline"><semantics id="S3.SS2.p2.4.m4.1a"><mi id="S3.SS2.p2.4.m4.1.1" xref="S3.SS2.p2.4.m4.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="S3.SS2.p2.4.m4.1b"><ci id="S3.SS2.p2.4.m4.1.1.cmml" xref="S3.SS2.p2.4.m4.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p2.4.m4.1c">k</annotation></semantics></math> serves as a threshold to control the scope of neighborhood retention, effectively eliminating areas predominantly filled with homogeneous data that do not contribute to an understanding of the spreadsheet’s layout and structure. We explored the effects of different <math id="S3.SS2.p2.5.m5.1" class="ltx_Math" alttext="k" display="inline"><semantics id="S3.SS2.p2.5.m5.1a"><mi id="S3.SS2.p2.5.m5.1.1" xref="S3.SS2.p2.5.m5.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="S3.SS2.p2.5.m5.1b"><ci id="S3.SS2.p2.5.m5.1.1.cmml" xref="S3.SS2.p2.5.m5.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p2.5.m5.1c">k</annotation></semantics></math> values in an ablation study, as detailed in Appendix <a href="#A4.SS1" title="D.1 Results on Structure-anchor Threshold ‣ Appendix D Ablation Experiment Results of Spreadsheet Table Detection ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">D.1</span></a>.</p>
</div>
<div id="S3.SS2.p3" class="ltx_para">
<p id="S3.SS2.p3.5" class="ltx_p">The extracted rows and columns can be expressed as:</p>
<table id="A13.EGx4" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex5"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex5.m1.3" class="ltx_Math" alttext="\displaystyle\mathcal{A}_{+}=\left\{r_{p_{+}},c_{q_{+}}\right\}_{p_{+}\in m,q_{+}\in n}," display="inline"><semantics id="S3.Ex5.m1.3a"><mrow id="S3.Ex5.m1.3.3.1" xref="S3.Ex5.m1.3.3.1.1.cmml"><mrow id="S3.Ex5.m1.3.3.1.1" xref="S3.Ex5.m1.3.3.1.1.cmml"><msub id="S3.Ex5.m1.3.3.1.1.4" xref="S3.Ex5.m1.3.3.1.1.4.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex5.m1.3.3.1.1.4.2" xref="S3.Ex5.m1.3.3.1.1.4.2.cmml">𝒜</mi><mo id="S3.Ex5.m1.3.3.1.1.4.3" xref="S3.Ex5.m1.3.3.1.1.4.3.cmml">+</mo></msub><mo id="S3.Ex5.m1.3.3.1.1.3" xref="S3.Ex5.m1.3.3.1.1.3.cmml">=</mo><msub id="S3.Ex5.m1.3.3.1.1.2" xref="S3.Ex5.m1.3.3.1.1.2.cmml"><mrow id="S3.Ex5.m1.3.3.1.1.2.2.2" xref="S3.Ex5.m1.3.3.1.1.2.2.3.cmml"><mo id="S3.Ex5.m1.3.3.1.1.2.2.2.3" xref="S3.Ex5.m1.3.3.1.1.2.2.3.cmml">{</mo><msub id="S3.Ex5.m1.3.3.1.1.1.1.1.1" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.cmml"><mi id="S3.Ex5.m1.3.3.1.1.1.1.1.1.2" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.2.cmml">r</mi><msub id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.cmml"><mi id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.2" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.2.cmml">p</mi><mo id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.3" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.3.cmml">+</mo></msub></msub><mo id="S3.Ex5.m1.3.3.1.1.2.2.2.4" xref="S3.Ex5.m1.3.3.1.1.2.2.3.cmml">,</mo><msub id="S3.Ex5.m1.3.3.1.1.2.2.2.2" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.cmml"><mi id="S3.Ex5.m1.3.3.1.1.2.2.2.2.2" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.2.cmml">c</mi><msub id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.cmml"><mi id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.2" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.2.cmml">q</mi><mo id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.3" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.3.cmml">+</mo></msub></msub><mo id="S3.Ex5.m1.3.3.1.1.2.2.2.5" xref="S3.Ex5.m1.3.3.1.1.2.2.3.cmml">}</mo></mrow><mrow id="S3.Ex5.m1.2.2.2.2" xref="S3.Ex5.m1.2.2.2.3.cmml"><mrow id="S3.Ex5.m1.1.1.1.1.1" xref="S3.Ex5.m1.1.1.1.1.1.cmml"><msub id="S3.Ex5.m1.1.1.1.1.1.2" xref="S3.Ex5.m1.1.1.1.1.1.2.cmml"><mi id="S3.Ex5.m1.1.1.1.1.1.2.2" xref="S3.Ex5.m1.1.1.1.1.1.2.2.cmml">p</mi><mo id="S3.Ex5.m1.1.1.1.1.1.2.3" xref="S3.Ex5.m1.1.1.1.1.1.2.3.cmml">+</mo></msub><mo id="S3.Ex5.m1.1.1.1.1.1.1" xref="S3.Ex5.m1.1.1.1.1.1.1.cmml">∈</mo><mi id="S3.Ex5.m1.1.1.1.1.1.3" xref="S3.Ex5.m1.1.1.1.1.1.3.cmml">m</mi></mrow><mo id="S3.Ex5.m1.2.2.2.2.3" xref="S3.Ex5.m1.2.2.2.3a.cmml">,</mo><mrow id="S3.Ex5.m1.2.2.2.2.2" xref="S3.Ex5.m1.2.2.2.2.2.cmml"><msub id="S3.Ex5.m1.2.2.2.2.2.2" xref="S3.Ex5.m1.2.2.2.2.2.2.cmml"><mi id="S3.Ex5.m1.2.2.2.2.2.2.2" xref="S3.Ex5.m1.2.2.2.2.2.2.2.cmml">q</mi><mo id="S3.Ex5.m1.2.2.2.2.2.2.3" xref="S3.Ex5.m1.2.2.2.2.2.2.3.cmml">+</mo></msub><mo id="S3.Ex5.m1.2.2.2.2.2.1" xref="S3.Ex5.m1.2.2.2.2.2.1.cmml">∈</mo><mi id="S3.Ex5.m1.2.2.2.2.2.3" xref="S3.Ex5.m1.2.2.2.2.2.3.cmml">n</mi></mrow></mrow></msub></mrow><mo id="S3.Ex5.m1.3.3.1.2" xref="S3.Ex5.m1.3.3.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex5.m1.3b"><apply id="S3.Ex5.m1.3.3.1.1.cmml" xref="S3.Ex5.m1.3.3.1"><eq id="S3.Ex5.m1.3.3.1.1.3.cmml" xref="S3.Ex5.m1.3.3.1.1.3"></eq><apply id="S3.Ex5.m1.3.3.1.1.4.cmml" xref="S3.Ex5.m1.3.3.1.1.4"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.4.1.cmml" xref="S3.Ex5.m1.3.3.1.1.4">subscript</csymbol><ci id="S3.Ex5.m1.3.3.1.1.4.2.cmml" xref="S3.Ex5.m1.3.3.1.1.4.2">𝒜</ci><plus id="S3.Ex5.m1.3.3.1.1.4.3.cmml" xref="S3.Ex5.m1.3.3.1.1.4.3"></plus></apply><apply id="S3.Ex5.m1.3.3.1.1.2.cmml" xref="S3.Ex5.m1.3.3.1.1.2"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.2.3.cmml" xref="S3.Ex5.m1.3.3.1.1.2">subscript</csymbol><set id="S3.Ex5.m1.3.3.1.1.2.2.3.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2"><apply id="S3.Ex5.m1.3.3.1.1.1.1.1.1.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.1.1.1.1.1.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1">subscript</csymbol><ci id="S3.Ex5.m1.3.3.1.1.1.1.1.1.2.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.2">𝑟</ci><apply id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.1.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3">subscript</csymbol><ci id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.2.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.2">𝑝</ci><plus id="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.3.cmml" xref="S3.Ex5.m1.3.3.1.1.1.1.1.1.3.3"></plus></apply></apply><apply id="S3.Ex5.m1.3.3.1.1.2.2.2.2.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.2.2.2.2.1.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2">subscript</csymbol><ci id="S3.Ex5.m1.3.3.1.1.2.2.2.2.2.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.2">𝑐</ci><apply id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3"><csymbol cd="ambiguous" id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.1.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3">subscript</csymbol><ci id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.2.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.2">𝑞</ci><plus id="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.3.cmml" xref="S3.Ex5.m1.3.3.1.1.2.2.2.2.3.3"></plus></apply></apply></set><apply id="S3.Ex5.m1.2.2.2.3.cmml" xref="S3.Ex5.m1.2.2.2.2"><csymbol cd="ambiguous" id="S3.Ex5.m1.2.2.2.3a.cmml" xref="S3.Ex5.m1.2.2.2.2.3">formulae-sequence</csymbol><apply id="S3.Ex5.m1.1.1.1.1.1.cmml" xref="S3.Ex5.m1.1.1.1.1.1"><in id="S3.Ex5.m1.1.1.1.1.1.1.cmml" xref="S3.Ex5.m1.1.1.1.1.1.1"></in><apply id="S3.Ex5.m1.1.1.1.1.1.2.cmml" xref="S3.Ex5.m1.1.1.1.1.1.2"><csymbol cd="ambiguous" id="S3.Ex5.m1.1.1.1.1.1.2.1.cmml" xref="S3.Ex5.m1.1.1.1.1.1.2">subscript</csymbol><ci id="S3.Ex5.m1.1.1.1.1.1.2.2.cmml" xref="S3.Ex5.m1.1.1.1.1.1.2.2">𝑝</ci><plus id="S3.Ex5.m1.1.1.1.1.1.2.3.cmml" xref="S3.Ex5.m1.1.1.1.1.1.2.3"></plus></apply><ci id="S3.Ex5.m1.1.1.1.1.1.3.cmml" xref="S3.Ex5.m1.1.1.1.1.1.3">𝑚</ci></apply><apply id="S3.Ex5.m1.2.2.2.2.2.cmml" xref="S3.Ex5.m1.2.2.2.2.2"><in id="S3.Ex5.m1.2.2.2.2.2.1.cmml" xref="S3.Ex5.m1.2.2.2.2.2.1"></in><apply id="S3.Ex5.m1.2.2.2.2.2.2.cmml" xref="S3.Ex5.m1.2.2.2.2.2.2"><csymbol cd="ambiguous" id="S3.Ex5.m1.2.2.2.2.2.2.1.cmml" xref="S3.Ex5.m1.2.2.2.2.2.2">subscript</csymbol><ci id="S3.Ex5.m1.2.2.2.2.2.2.2.cmml" xref="S3.Ex5.m1.2.2.2.2.2.2.2">𝑞</ci><plus id="S3.Ex5.m1.2.2.2.2.2.2.3.cmml" xref="S3.Ex5.m1.2.2.2.2.2.2.3"></plus></apply><ci id="S3.Ex5.m1.2.2.2.2.2.3.cmml" xref="S3.Ex5.m1.2.2.2.2.2.3">𝑛</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex5.m1.3c">\displaystyle\mathcal{A}_{+}=\left\{r_{p_{+}},c_{q_{+}}\right\}_{p_{+}\in m,q_{+}\in n},</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(4)</span></td>
</tr></tbody>
</table>
<p id="S3.SS2.p3.2" class="ltx_p">where the extracted "skeletons" are defined as: <math id="S3.SS2.p3.1.m1.5" class="ltx_Math" alttext="r_{p_{+}}=\left\{Cell_{i,j}\right\}_{|i-p|\leq k,j\in n}" display="inline"><semantics id="S3.SS2.p3.1.m1.5a"><mrow id="S3.SS2.p3.1.m1.5.5" xref="S3.SS2.p3.1.m1.5.5.cmml"><msub id="S3.SS2.p3.1.m1.5.5.3" xref="S3.SS2.p3.1.m1.5.5.3.cmml"><mi id="S3.SS2.p3.1.m1.5.5.3.2" xref="S3.SS2.p3.1.m1.5.5.3.2.cmml">r</mi><msub id="S3.SS2.p3.1.m1.5.5.3.3" xref="S3.SS2.p3.1.m1.5.5.3.3.cmml"><mi id="S3.SS2.p3.1.m1.5.5.3.3.2" xref="S3.SS2.p3.1.m1.5.5.3.3.2.cmml">p</mi><mo id="S3.SS2.p3.1.m1.5.5.3.3.3" xref="S3.SS2.p3.1.m1.5.5.3.3.3.cmml">+</mo></msub></msub><mo id="S3.SS2.p3.1.m1.5.5.2" xref="S3.SS2.p3.1.m1.5.5.2.cmml">=</mo><msub id="S3.SS2.p3.1.m1.5.5.1" xref="S3.SS2.p3.1.m1.5.5.1.cmml"><mrow id="S3.SS2.p3.1.m1.5.5.1.1.1" xref="S3.SS2.p3.1.m1.5.5.1.1.2.cmml"><mo id="S3.SS2.p3.1.m1.5.5.1.1.1.2" xref="S3.SS2.p3.1.m1.5.5.1.1.2.cmml">{</mo><mrow id="S3.SS2.p3.1.m1.5.5.1.1.1.1" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.cmml"><mi id="S3.SS2.p3.1.m1.5.5.1.1.1.1.2" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.1.m1.5.5.1.1.1.1.1" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p3.1.m1.5.5.1.1.1.1.3" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.1.m1.5.5.1.1.1.1.1a" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p3.1.m1.5.5.1.1.1.1.4" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.1.m1.5.5.1.1.1.1.1b" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.1.cmml">​</mo><msub id="S3.SS2.p3.1.m1.5.5.1.1.1.1.5" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.cmml"><mi id="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.2" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.SS2.p3.1.m1.2.2.2.4" xref="S3.SS2.p3.1.m1.2.2.2.3.cmml"><mi id="S3.SS2.p3.1.m1.1.1.1.1" xref="S3.SS2.p3.1.m1.1.1.1.1.cmml">i</mi><mo id="S3.SS2.p3.1.m1.2.2.2.4.1" xref="S3.SS2.p3.1.m1.2.2.2.3.cmml">,</mo><mi id="S3.SS2.p3.1.m1.2.2.2.2" xref="S3.SS2.p3.1.m1.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.SS2.p3.1.m1.5.5.1.1.1.3" xref="S3.SS2.p3.1.m1.5.5.1.1.2.cmml">}</mo></mrow><mrow id="S3.SS2.p3.1.m1.4.4.2.2" xref="S3.SS2.p3.1.m1.4.4.2.3.cmml"><mrow id="S3.SS2.p3.1.m1.3.3.1.1.1" xref="S3.SS2.p3.1.m1.3.3.1.1.1.cmml"><mrow id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.2.cmml"><mo stretchy="false" id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.2" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.2.1.cmml">|</mo><mrow id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.cmml"><mi id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.2" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.2.cmml">i</mi><mo id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.1" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.1.cmml">−</mo><mi id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.3" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.3.cmml">p</mi></mrow><mo stretchy="false" id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.3" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.2.1.cmml">|</mo></mrow><mo id="S3.SS2.p3.1.m1.3.3.1.1.1.2" xref="S3.SS2.p3.1.m1.3.3.1.1.1.2.cmml">≤</mo><mi id="S3.SS2.p3.1.m1.3.3.1.1.1.3" xref="S3.SS2.p3.1.m1.3.3.1.1.1.3.cmml">k</mi></mrow><mo id="S3.SS2.p3.1.m1.4.4.2.2.3" xref="S3.SS2.p3.1.m1.4.4.2.3a.cmml">,</mo><mrow id="S3.SS2.p3.1.m1.4.4.2.2.2" xref="S3.SS2.p3.1.m1.4.4.2.2.2.cmml"><mi id="S3.SS2.p3.1.m1.4.4.2.2.2.2" xref="S3.SS2.p3.1.m1.4.4.2.2.2.2.cmml">j</mi><mo id="S3.SS2.p3.1.m1.4.4.2.2.2.1" xref="S3.SS2.p3.1.m1.4.4.2.2.2.1.cmml">∈</mo><mi id="S3.SS2.p3.1.m1.4.4.2.2.2.3" xref="S3.SS2.p3.1.m1.4.4.2.2.2.3.cmml">n</mi></mrow></mrow></msub></mrow><annotation-xml encoding="MathML-Content" id="S3.SS2.p3.1.m1.5b"><apply id="S3.SS2.p3.1.m1.5.5.cmml" xref="S3.SS2.p3.1.m1.5.5"><eq id="S3.SS2.p3.1.m1.5.5.2.cmml" xref="S3.SS2.p3.1.m1.5.5.2"></eq><apply id="S3.SS2.p3.1.m1.5.5.3.cmml" xref="S3.SS2.p3.1.m1.5.5.3"><csymbol cd="ambiguous" id="S3.SS2.p3.1.m1.5.5.3.1.cmml" xref="S3.SS2.p3.1.m1.5.5.3">subscript</csymbol><ci id="S3.SS2.p3.1.m1.5.5.3.2.cmml" xref="S3.SS2.p3.1.m1.5.5.3.2">𝑟</ci><apply id="S3.SS2.p3.1.m1.5.5.3.3.cmml" xref="S3.SS2.p3.1.m1.5.5.3.3"><csymbol cd="ambiguous" id="S3.SS2.p3.1.m1.5.5.3.3.1.cmml" xref="S3.SS2.p3.1.m1.5.5.3.3">subscript</csymbol><ci id="S3.SS2.p3.1.m1.5.5.3.3.2.cmml" xref="S3.SS2.p3.1.m1.5.5.3.3.2">𝑝</ci><plus id="S3.SS2.p3.1.m1.5.5.3.3.3.cmml" xref="S3.SS2.p3.1.m1.5.5.3.3.3"></plus></apply></apply><apply id="S3.SS2.p3.1.m1.5.5.1.cmml" xref="S3.SS2.p3.1.m1.5.5.1"><csymbol cd="ambiguous" id="S3.SS2.p3.1.m1.5.5.1.2.cmml" xref="S3.SS2.p3.1.m1.5.5.1">subscript</csymbol><set id="S3.SS2.p3.1.m1.5.5.1.1.2.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1"><apply id="S3.SS2.p3.1.m1.5.5.1.1.1.1.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1"><times id="S3.SS2.p3.1.m1.5.5.1.1.1.1.1.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.1"></times><ci id="S3.SS2.p3.1.m1.5.5.1.1.1.1.2.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.2">𝐶</ci><ci id="S3.SS2.p3.1.m1.5.5.1.1.1.1.3.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.3">𝑒</ci><ci id="S3.SS2.p3.1.m1.5.5.1.1.1.1.4.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.4">𝑙</ci><apply id="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.1.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.5">subscript</csymbol><ci id="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.2.cmml" xref="S3.SS2.p3.1.m1.5.5.1.1.1.1.5.2">𝑙</ci><list id="S3.SS2.p3.1.m1.2.2.2.3.cmml" xref="S3.SS2.p3.1.m1.2.2.2.4"><ci id="S3.SS2.p3.1.m1.1.1.1.1.cmml" xref="S3.SS2.p3.1.m1.1.1.1.1">𝑖</ci><ci id="S3.SS2.p3.1.m1.2.2.2.2.cmml" xref="S3.SS2.p3.1.m1.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.SS2.p3.1.m1.4.4.2.3.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2"><csymbol cd="ambiguous" id="S3.SS2.p3.1.m1.4.4.2.3a.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.SS2.p3.1.m1.3.3.1.1.1.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1"><leq id="S3.SS2.p3.1.m1.3.3.1.1.1.2.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.2"></leq><apply id="S3.SS2.p3.1.m1.3.3.1.1.1.1.2.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1"><abs id="S3.SS2.p3.1.m1.3.3.1.1.1.1.2.1.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.2"></abs><apply id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1"><minus id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.1.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.1"></minus><ci id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.2.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.2">𝑖</ci><ci id="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.3.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.1.1.1.3">𝑝</ci></apply></apply><ci id="S3.SS2.p3.1.m1.3.3.1.1.1.3.cmml" xref="S3.SS2.p3.1.m1.3.3.1.1.1.3">𝑘</ci></apply><apply id="S3.SS2.p3.1.m1.4.4.2.2.2.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2.2"><in id="S3.SS2.p3.1.m1.4.4.2.2.2.1.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2.2.1"></in><ci id="S3.SS2.p3.1.m1.4.4.2.2.2.2.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2.2.2">𝑗</ci><ci id="S3.SS2.p3.1.m1.4.4.2.2.2.3.cmml" xref="S3.SS2.p3.1.m1.4.4.2.2.2.3">𝑛</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p3.1.m1.5c">r_{p_{+}}=\left\{Cell_{i,j}\right\}_{|i-p|\leq k,j\in n}</annotation></semantics></math> and <math id="S3.SS2.p3.2.m2.5" class="ltx_Math" alttext="c_{q_{+}}=\left\{Cell_{i,j}\right\}_{i\in m,|j-q|\leq k}" display="inline"><semantics id="S3.SS2.p3.2.m2.5a"><mrow id="S3.SS2.p3.2.m2.5.5" xref="S3.SS2.p3.2.m2.5.5.cmml"><msub id="S3.SS2.p3.2.m2.5.5.3" xref="S3.SS2.p3.2.m2.5.5.3.cmml"><mi id="S3.SS2.p3.2.m2.5.5.3.2" xref="S3.SS2.p3.2.m2.5.5.3.2.cmml">c</mi><msub id="S3.SS2.p3.2.m2.5.5.3.3" xref="S3.SS2.p3.2.m2.5.5.3.3.cmml"><mi id="S3.SS2.p3.2.m2.5.5.3.3.2" xref="S3.SS2.p3.2.m2.5.5.3.3.2.cmml">q</mi><mo id="S3.SS2.p3.2.m2.5.5.3.3.3" xref="S3.SS2.p3.2.m2.5.5.3.3.3.cmml">+</mo></msub></msub><mo id="S3.SS2.p3.2.m2.5.5.2" xref="S3.SS2.p3.2.m2.5.5.2.cmml">=</mo><msub id="S3.SS2.p3.2.m2.5.5.1" xref="S3.SS2.p3.2.m2.5.5.1.cmml"><mrow id="S3.SS2.p3.2.m2.5.5.1.1.1" xref="S3.SS2.p3.2.m2.5.5.1.1.2.cmml"><mo id="S3.SS2.p3.2.m2.5.5.1.1.1.2" xref="S3.SS2.p3.2.m2.5.5.1.1.2.cmml">{</mo><mrow id="S3.SS2.p3.2.m2.5.5.1.1.1.1" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.cmml"><mi id="S3.SS2.p3.2.m2.5.5.1.1.1.1.2" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.2.m2.5.5.1.1.1.1.1" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p3.2.m2.5.5.1.1.1.1.3" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.2.m2.5.5.1.1.1.1.1a" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.1.cmml">​</mo><mi id="S3.SS2.p3.2.m2.5.5.1.1.1.1.4" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.SS2.p3.2.m2.5.5.1.1.1.1.1b" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.1.cmml">​</mo><msub id="S3.SS2.p3.2.m2.5.5.1.1.1.1.5" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.cmml"><mi id="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.2" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.SS2.p3.2.m2.2.2.2.4" xref="S3.SS2.p3.2.m2.2.2.2.3.cmml"><mi id="S3.SS2.p3.2.m2.1.1.1.1" xref="S3.SS2.p3.2.m2.1.1.1.1.cmml">i</mi><mo id="S3.SS2.p3.2.m2.2.2.2.4.1" xref="S3.SS2.p3.2.m2.2.2.2.3.cmml">,</mo><mi id="S3.SS2.p3.2.m2.2.2.2.2" xref="S3.SS2.p3.2.m2.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.SS2.p3.2.m2.5.5.1.1.1.3" xref="S3.SS2.p3.2.m2.5.5.1.1.2.cmml">}</mo></mrow><mrow id="S3.SS2.p3.2.m2.4.4.2.2" xref="S3.SS2.p3.2.m2.4.4.2.3.cmml"><mrow id="S3.SS2.p3.2.m2.3.3.1.1.1" xref="S3.SS2.p3.2.m2.3.3.1.1.1.cmml"><mi id="S3.SS2.p3.2.m2.3.3.1.1.1.2" xref="S3.SS2.p3.2.m2.3.3.1.1.1.2.cmml">i</mi><mo id="S3.SS2.p3.2.m2.3.3.1.1.1.1" xref="S3.SS2.p3.2.m2.3.3.1.1.1.1.cmml">∈</mo><mi id="S3.SS2.p3.2.m2.3.3.1.1.1.3" xref="S3.SS2.p3.2.m2.3.3.1.1.1.3.cmml">m</mi></mrow><mo id="S3.SS2.p3.2.m2.4.4.2.2.3" xref="S3.SS2.p3.2.m2.4.4.2.3a.cmml">,</mo><mrow id="S3.SS2.p3.2.m2.4.4.2.2.2" xref="S3.SS2.p3.2.m2.4.4.2.2.2.cmml"><mrow id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.2.cmml"><mo stretchy="false" id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.2" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.2.1.cmml">|</mo><mrow id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.cmml"><mi id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.2" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.2.cmml">j</mi><mo id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.1" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.1.cmml">−</mo><mi id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.3" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.3.cmml">q</mi></mrow><mo stretchy="false" id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.3" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.2.1.cmml">|</mo></mrow><mo id="S3.SS2.p3.2.m2.4.4.2.2.2.2" xref="S3.SS2.p3.2.m2.4.4.2.2.2.2.cmml">≤</mo><mi id="S3.SS2.p3.2.m2.4.4.2.2.2.3" xref="S3.SS2.p3.2.m2.4.4.2.2.2.3.cmml">k</mi></mrow></mrow></msub></mrow><annotation-xml encoding="MathML-Content" id="S3.SS2.p3.2.m2.5b"><apply id="S3.SS2.p3.2.m2.5.5.cmml" xref="S3.SS2.p3.2.m2.5.5"><eq id="S3.SS2.p3.2.m2.5.5.2.cmml" xref="S3.SS2.p3.2.m2.5.5.2"></eq><apply id="S3.SS2.p3.2.m2.5.5.3.cmml" xref="S3.SS2.p3.2.m2.5.5.3"><csymbol cd="ambiguous" id="S3.SS2.p3.2.m2.5.5.3.1.cmml" xref="S3.SS2.p3.2.m2.5.5.3">subscript</csymbol><ci id="S3.SS2.p3.2.m2.5.5.3.2.cmml" xref="S3.SS2.p3.2.m2.5.5.3.2">𝑐</ci><apply id="S3.SS2.p3.2.m2.5.5.3.3.cmml" xref="S3.SS2.p3.2.m2.5.5.3.3"><csymbol cd="ambiguous" id="S3.SS2.p3.2.m2.5.5.3.3.1.cmml" xref="S3.SS2.p3.2.m2.5.5.3.3">subscript</csymbol><ci id="S3.SS2.p3.2.m2.5.5.3.3.2.cmml" xref="S3.SS2.p3.2.m2.5.5.3.3.2">𝑞</ci><plus id="S3.SS2.p3.2.m2.5.5.3.3.3.cmml" xref="S3.SS2.p3.2.m2.5.5.3.3.3"></plus></apply></apply><apply id="S3.SS2.p3.2.m2.5.5.1.cmml" xref="S3.SS2.p3.2.m2.5.5.1"><csymbol cd="ambiguous" id="S3.SS2.p3.2.m2.5.5.1.2.cmml" xref="S3.SS2.p3.2.m2.5.5.1">subscript</csymbol><set id="S3.SS2.p3.2.m2.5.5.1.1.2.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1"><apply id="S3.SS2.p3.2.m2.5.5.1.1.1.1.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1"><times id="S3.SS2.p3.2.m2.5.5.1.1.1.1.1.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.1"></times><ci id="S3.SS2.p3.2.m2.5.5.1.1.1.1.2.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.2">𝐶</ci><ci id="S3.SS2.p3.2.m2.5.5.1.1.1.1.3.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.3">𝑒</ci><ci id="S3.SS2.p3.2.m2.5.5.1.1.1.1.4.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.4">𝑙</ci><apply id="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.1.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.5">subscript</csymbol><ci id="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.2.cmml" xref="S3.SS2.p3.2.m2.5.5.1.1.1.1.5.2">𝑙</ci><list id="S3.SS2.p3.2.m2.2.2.2.3.cmml" xref="S3.SS2.p3.2.m2.2.2.2.4"><ci id="S3.SS2.p3.2.m2.1.1.1.1.cmml" xref="S3.SS2.p3.2.m2.1.1.1.1">𝑖</ci><ci id="S3.SS2.p3.2.m2.2.2.2.2.cmml" xref="S3.SS2.p3.2.m2.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.SS2.p3.2.m2.4.4.2.3.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2"><csymbol cd="ambiguous" id="S3.SS2.p3.2.m2.4.4.2.3a.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.SS2.p3.2.m2.3.3.1.1.1.cmml" xref="S3.SS2.p3.2.m2.3.3.1.1.1"><in id="S3.SS2.p3.2.m2.3.3.1.1.1.1.cmml" xref="S3.SS2.p3.2.m2.3.3.1.1.1.1"></in><ci id="S3.SS2.p3.2.m2.3.3.1.1.1.2.cmml" xref="S3.SS2.p3.2.m2.3.3.1.1.1.2">𝑖</ci><ci id="S3.SS2.p3.2.m2.3.3.1.1.1.3.cmml" xref="S3.SS2.p3.2.m2.3.3.1.1.1.3">𝑚</ci></apply><apply id="S3.SS2.p3.2.m2.4.4.2.2.2.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2"><leq id="S3.SS2.p3.2.m2.4.4.2.2.2.2.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.2"></leq><apply id="S3.SS2.p3.2.m2.4.4.2.2.2.1.2.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1"><abs id="S3.SS2.p3.2.m2.4.4.2.2.2.1.2.1.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.2"></abs><apply id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1"><minus id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.1.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.1"></minus><ci id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.2.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.2">𝑗</ci><ci id="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.3.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.1.1.1.3">𝑞</ci></apply></apply><ci id="S3.SS2.p3.2.m2.4.4.2.2.2.3.cmml" xref="S3.SS2.p3.2.m2.4.4.2.2.2.3">𝑘</ci></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p3.2.m2.5c">c_{q_{+}}=\left\{Cell_{i,j}\right\}_{i\in m,|j-q|\leq k}</annotation></semantics></math>.
Then we obtain the extracted compact spreadsheet:</p>
<table id="A13.EGx5" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex6"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex6.m1.2" class="ltx_Math" alttext="\displaystyle\mathcal{S}_{e}=\mathrm{extract}(\mathcal{S})=\mathrm{address\_map}(r_{p_{+}}\!\cap c_{q_{+}})." display="inline"><semantics id="S3.Ex6.m1.2a"><mrow id="S3.Ex6.m1.2.2.1" xref="S3.Ex6.m1.2.2.1.1.cmml"><mrow id="S3.Ex6.m1.2.2.1.1" xref="S3.Ex6.m1.2.2.1.1.cmml"><msub id="S3.Ex6.m1.2.2.1.1.3" xref="S3.Ex6.m1.2.2.1.1.3.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex6.m1.2.2.1.1.3.2" xref="S3.Ex6.m1.2.2.1.1.3.2.cmml">𝒮</mi><mi id="S3.Ex6.m1.2.2.1.1.3.3" xref="S3.Ex6.m1.2.2.1.1.3.3.cmml">e</mi></msub><mo id="S3.Ex6.m1.2.2.1.1.4" xref="S3.Ex6.m1.2.2.1.1.4.cmml">=</mo><mrow id="S3.Ex6.m1.2.2.1.1.5" xref="S3.Ex6.m1.2.2.1.1.5.cmml"><mi id="S3.Ex6.m1.2.2.1.1.5.2" xref="S3.Ex6.m1.2.2.1.1.5.2.cmml">extract</mi><mo lspace="0em" rspace="0em" id="S3.Ex6.m1.2.2.1.1.5.1" xref="S3.Ex6.m1.2.2.1.1.5.1.cmml">​</mo><mrow id="S3.Ex6.m1.2.2.1.1.5.3.2" xref="S3.Ex6.m1.2.2.1.1.5.cmml"><mo stretchy="false" id="S3.Ex6.m1.2.2.1.1.5.3.2.1" xref="S3.Ex6.m1.2.2.1.1.5.cmml">(</mo><mi class="ltx_font_mathcaligraphic" id="S3.Ex6.m1.1.1" xref="S3.Ex6.m1.1.1.cmml">𝒮</mi><mo stretchy="false" id="S3.Ex6.m1.2.2.1.1.5.3.2.2" xref="S3.Ex6.m1.2.2.1.1.5.cmml">)</mo></mrow></mrow><mo id="S3.Ex6.m1.2.2.1.1.6" xref="S3.Ex6.m1.2.2.1.1.6.cmml">=</mo><mrow id="S3.Ex6.m1.2.2.1.1.1" xref="S3.Ex6.m1.2.2.1.1.1.cmml"><mi id="S3.Ex6.m1.2.2.1.1.1.3" xref="S3.Ex6.m1.2.2.1.1.1.3.cmml">address</mi><mo lspace="0em" rspace="0em" id="S3.Ex6.m1.2.2.1.1.1.2" xref="S3.Ex6.m1.2.2.1.1.1.2.cmml">​</mo><mi mathvariant="normal" id="S3.Ex6.m1.2.2.1.1.1.4" xref="S3.Ex6.m1.2.2.1.1.1.4.cmml">_</mi><mo lspace="0em" rspace="0em" id="S3.Ex6.m1.2.2.1.1.1.2a" xref="S3.Ex6.m1.2.2.1.1.1.2.cmml">​</mo><mi id="S3.Ex6.m1.2.2.1.1.1.5" xref="S3.Ex6.m1.2.2.1.1.1.5.cmml">map</mi><mo lspace="0em" rspace="0em" id="S3.Ex6.m1.2.2.1.1.1.2b" xref="S3.Ex6.m1.2.2.1.1.1.2.cmml">​</mo><mrow id="S3.Ex6.m1.2.2.1.1.1.1.1" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.cmml"><mo stretchy="false" id="S3.Ex6.m1.2.2.1.1.1.1.1.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.cmml">(</mo><mrow id="S3.Ex6.m1.2.2.1.1.1.1.1.1" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.cmml"><msub id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.cmml"><mi id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.2.cmml">r</mi><msub id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.cmml"><mi id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.2.cmml">p</mi><mo id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.3.cmml">+</mo></msub></msub><mo id="S3.Ex6.m1.2.2.1.1.1.1.1.1.1" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.1.cmml">∩</mo><msub id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.cmml"><mi id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.2.cmml">c</mi><msub id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.cmml"><mi id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.2" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.2.cmml">q</mi><mo id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.3.cmml">+</mo></msub></msub></mrow><mo stretchy="false" id="S3.Ex6.m1.2.2.1.1.1.1.1.3" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.cmml">)</mo></mrow></mrow></mrow><mo lspace="0em" id="S3.Ex6.m1.2.2.1.2" xref="S3.Ex6.m1.2.2.1.1.cmml">.</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex6.m1.2b"><apply id="S3.Ex6.m1.2.2.1.1.cmml" xref="S3.Ex6.m1.2.2.1"><and id="S3.Ex6.m1.2.2.1.1a.cmml" xref="S3.Ex6.m1.2.2.1"></and><apply id="S3.Ex6.m1.2.2.1.1b.cmml" xref="S3.Ex6.m1.2.2.1"><eq id="S3.Ex6.m1.2.2.1.1.4.cmml" xref="S3.Ex6.m1.2.2.1.1.4"></eq><apply id="S3.Ex6.m1.2.2.1.1.3.cmml" xref="S3.Ex6.m1.2.2.1.1.3"><csymbol cd="ambiguous" id="S3.Ex6.m1.2.2.1.1.3.1.cmml" xref="S3.Ex6.m1.2.2.1.1.3">subscript</csymbol><ci id="S3.Ex6.m1.2.2.1.1.3.2.cmml" xref="S3.Ex6.m1.2.2.1.1.3.2">𝒮</ci><ci id="S3.Ex6.m1.2.2.1.1.3.3.cmml" xref="S3.Ex6.m1.2.2.1.1.3.3">𝑒</ci></apply><apply id="S3.Ex6.m1.2.2.1.1.5.cmml" xref="S3.Ex6.m1.2.2.1.1.5"><times id="S3.Ex6.m1.2.2.1.1.5.1.cmml" xref="S3.Ex6.m1.2.2.1.1.5.1"></times><ci id="S3.Ex6.m1.2.2.1.1.5.2.cmml" xref="S3.Ex6.m1.2.2.1.1.5.2">extract</ci><ci id="S3.Ex6.m1.1.1.cmml" xref="S3.Ex6.m1.1.1">𝒮</ci></apply></apply><apply id="S3.Ex6.m1.2.2.1.1c.cmml" xref="S3.Ex6.m1.2.2.1"><eq id="S3.Ex6.m1.2.2.1.1.6.cmml" xref="S3.Ex6.m1.2.2.1.1.6"></eq><share href="#S3.Ex6.m1.2.2.1.1.5.cmml" id="S3.Ex6.m1.2.2.1.1d.cmml" xref="S3.Ex6.m1.2.2.1"></share><apply id="S3.Ex6.m1.2.2.1.1.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1"><times id="S3.Ex6.m1.2.2.1.1.1.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.2"></times><ci id="S3.Ex6.m1.2.2.1.1.1.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.3">address</ci><ci id="S3.Ex6.m1.2.2.1.1.1.4.cmml" xref="S3.Ex6.m1.2.2.1.1.1.4">_</ci><ci id="S3.Ex6.m1.2.2.1.1.1.5.cmml" xref="S3.Ex6.m1.2.2.1.1.1.5">map</ci><apply id="S3.Ex6.m1.2.2.1.1.1.1.1.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1"><intersect id="S3.Ex6.m1.2.2.1.1.1.1.1.1.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.1"></intersect><apply id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2"><csymbol cd="ambiguous" id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2">subscript</csymbol><ci id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.2">𝑟</ci><apply id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3"><csymbol cd="ambiguous" id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3">subscript</csymbol><ci id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.2">𝑝</ci><plus id="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.2.3.3"></plus></apply></apply><apply id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3"><csymbol cd="ambiguous" id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3">subscript</csymbol><ci id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.2">𝑐</ci><apply id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3"><csymbol cd="ambiguous" id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.1.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3">subscript</csymbol><ci id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.2.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.2">𝑞</ci><plus id="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.3.cmml" xref="S3.Ex6.m1.2.2.1.1.1.1.1.1.3.3.3"></plus></apply></apply></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex6.m1.2c">\displaystyle\mathcal{S}_{e}=\mathrm{extract}(\mathcal{S})=\mathrm{address\_map}(r_{p_{+}}\!\cap c_{q_{+}}).</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(5)</span></td>
</tr></tbody>
</table>
<p id="S3.SS2.p3.4" class="ltx_p">Based on the compressed spreadsheet <math id="S3.SS2.p3.3.m1.1" class="ltx_Math" alttext="\mathcal{S}_{e}" display="inline"><semantics id="S3.SS2.p3.3.m1.1a"><msub id="S3.SS2.p3.3.m1.1.1" xref="S3.SS2.p3.3.m1.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.SS2.p3.3.m1.1.1.2" xref="S3.SS2.p3.3.m1.1.1.2.cmml">𝒮</mi><mi id="S3.SS2.p3.3.m1.1.1.3" xref="S3.SS2.p3.3.m1.1.1.3.cmml">e</mi></msub><annotation-xml encoding="MathML-Content" id="S3.SS2.p3.3.m1.1b"><apply id="S3.SS2.p3.3.m1.1.1.cmml" xref="S3.SS2.p3.3.m1.1.1"><csymbol cd="ambiguous" id="S3.SS2.p3.3.m1.1.1.1.cmml" xref="S3.SS2.p3.3.m1.1.1">subscript</csymbol><ci id="S3.SS2.p3.3.m1.1.1.2.cmml" xref="S3.SS2.p3.3.m1.1.1.2">𝒮</ci><ci id="S3.SS2.p3.3.m1.1.1.3.cmml" xref="S3.SS2.p3.3.m1.1.1.3">𝑒</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p3.3.m1.1c">\mathcal{S}_{e}</annotation></semantics></math>, we can obtain extremely shorter text representation <math id="S3.SS2.p3.4.m2.1" class="ltx_Math" alttext="\mathcal{T}_{e}" display="inline"><semantics id="S3.SS2.p3.4.m2.1a"><msub id="S3.SS2.p3.4.m2.1.1" xref="S3.SS2.p3.4.m2.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.SS2.p3.4.m2.1.1.2" xref="S3.SS2.p3.4.m2.1.1.2.cmml">𝒯</mi><mi id="S3.SS2.p3.4.m2.1.1.3" xref="S3.SS2.p3.4.m2.1.1.3.cmml">e</mi></msub><annotation-xml encoding="MathML-Content" id="S3.SS2.p3.4.m2.1b"><apply id="S3.SS2.p3.4.m2.1.1.cmml" xref="S3.SS2.p3.4.m2.1.1"><csymbol cd="ambiguous" id="S3.SS2.p3.4.m2.1.1.1.cmml" xref="S3.SS2.p3.4.m2.1.1">subscript</csymbol><ci id="S3.SS2.p3.4.m2.1.1.2.cmml" xref="S3.SS2.p3.4.m2.1.1.2">𝒯</ci><ci id="S3.SS2.p3.4.m2.1.1.3.cmml" xref="S3.SS2.p3.4.m2.1.1.3">𝑒</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.SS2.p3.4.m2.1c">\mathcal{T}_{e}</annotation></semantics></math>.
Furthermore, after extraction, we perform a coordinate re-mapping to ensure continuity in cell coordinates, preserving the integrity of data relationships within the compressed spreadsheet. This re-mapping is critical for maintaining the accuracy of prediction results, ensuring that analyses remain consistent even after compression. This method filters out 75% spreadsheet content but preserves 97% rows and columns at the edges of table boundaries.</p>
</div>
</section>
<section id="S3.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">3.3 </span>Inverted-index Translation</h3>

<div id="S3.SS3.p1" class="ltx_para">
<p id="S3.SS3.p1.1" class="ltx_p">Spreadsheets often contain numerous empty rows, columns, and scattered cells. The standard encoding method, as detailed in Section <a href="#S3.SS1" title="3.1 Vanilla Spreadsheet Encoding with Cell Value, Address, and Format ‣ 3 Method ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3.1</span></a>, employs a grid-based method that pairs cell addresses with their contents. This approach necessitates recording empty cells to maintain the spreadsheet’s two-dimensional structure, which significantly increases token consumption. Furthermore, cells with identical values are encoded repeatedly, further exacerbating token usage.</p>
</div>
<div id="S3.SS3.p2" class="ltx_para">
<p id="S3.SS3.p2.1" class="ltx_p">To address these inefficiencies, we propose a two-stage Inverted-index-based Translation method. The first stage involves converting the traditional matrix-style encoding into a dictionary format, where cell values serve as keys indexing the addresses. In the second stage, cells sharing the same value are merged, with empty cells excluded and cell addresses noted as ranges. This method effectively reduces the number of required tokens by eliminating redundancies and simplifying the representation of repeated and empty cells. The translation process is represented mathematically as follows:</p>
<table id="A13.EGx6" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex7"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex7.m1.1" class="ltx_Math" alttext="\displaystyle\mathcal{T}_{t}" display="inline"><semantics id="S3.Ex7.m1.1a"><msub id="S3.Ex7.m1.1.1" xref="S3.Ex7.m1.1.1.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex7.m1.1.1.2" xref="S3.Ex7.m1.1.1.2.cmml">𝒯</mi><mi id="S3.Ex7.m1.1.1.3" xref="S3.Ex7.m1.1.1.3.cmml">t</mi></msub><annotation-xml encoding="MathML-Content" id="S3.Ex7.m1.1b"><apply id="S3.Ex7.m1.1.1.cmml" xref="S3.Ex7.m1.1.1"><csymbol cd="ambiguous" id="S3.Ex7.m1.1.1.1.cmml" xref="S3.Ex7.m1.1.1">subscript</csymbol><ci id="S3.Ex7.m1.1.1.2.cmml" xref="S3.Ex7.m1.1.1.2">𝒯</ci><ci id="S3.Ex7.m1.1.1.3.cmml" xref="S3.Ex7.m1.1.1.3">𝑡</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex7.m1.1c">\displaystyle\mathcal{T}_{t}</annotation></semantics></math></td>
<td class="ltx_td ltx_align_left ltx_eqn_cell"><math id="S3.Ex7.m2.1" class="ltx_Math" alttext="\displaystyle=\mathrm{invert}(\mathcal{T})" display="inline"><semantics id="S3.Ex7.m2.1a"><mrow id="S3.Ex7.m2.1.2" xref="S3.Ex7.m2.1.2.cmml"><mi id="S3.Ex7.m2.1.2.2" xref="S3.Ex7.m2.1.2.2.cmml"></mi><mo id="S3.Ex7.m2.1.2.1" xref="S3.Ex7.m2.1.2.1.cmml">=</mo><mrow id="S3.Ex7.m2.1.2.3" xref="S3.Ex7.m2.1.2.3.cmml"><mi id="S3.Ex7.m2.1.2.3.2" xref="S3.Ex7.m2.1.2.3.2.cmml">invert</mi><mo lspace="0em" rspace="0em" id="S3.Ex7.m2.1.2.3.1" xref="S3.Ex7.m2.1.2.3.1.cmml">​</mo><mrow id="S3.Ex7.m2.1.2.3.3.2" xref="S3.Ex7.m2.1.2.3.cmml"><mo stretchy="false" id="S3.Ex7.m2.1.2.3.3.2.1" xref="S3.Ex7.m2.1.2.3.cmml">(</mo><mi class="ltx_font_mathcaligraphic" id="S3.Ex7.m2.1.1" xref="S3.Ex7.m2.1.1.cmml">𝒯</mi><mo stretchy="false" id="S3.Ex7.m2.1.2.3.3.2.2" xref="S3.Ex7.m2.1.2.3.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex7.m2.1b"><apply id="S3.Ex7.m2.1.2.cmml" xref="S3.Ex7.m2.1.2"><eq id="S3.Ex7.m2.1.2.1.cmml" xref="S3.Ex7.m2.1.2.1"></eq><csymbol cd="latexml" id="S3.Ex7.m2.1.2.2.cmml" xref="S3.Ex7.m2.1.2.2">absent</csymbol><apply id="S3.Ex7.m2.1.2.3.cmml" xref="S3.Ex7.m2.1.2.3"><times id="S3.Ex7.m2.1.2.3.1.cmml" xref="S3.Ex7.m2.1.2.3.1"></times><ci id="S3.Ex7.m2.1.2.3.2.cmml" xref="S3.Ex7.m2.1.2.3.2">invert</ci><ci id="S3.Ex7.m2.1.1.cmml" xref="S3.Ex7.m2.1.1">𝒯</ci></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex7.m2.1c">\displaystyle=\mathrm{invert}(\mathcal{T})</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
</tr></tbody>
<tbody id="S3.Ex8"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex8.m1.1" class="ltx_Math" alttext="\displaystyle:" display="inline"><semantics id="S3.Ex8.m1.1a"><mo id="S3.Ex8.m1.1.1" xref="S3.Ex8.m1.1.1.cmml">:</mo><annotation-xml encoding="MathML-Content" id="S3.Ex8.m1.1b"><ci id="S3.Ex8.m1.1.1.cmml" xref="S3.Ex8.m1.1.1">:</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex8.m1.1c">\displaystyle:</annotation></semantics></math></td>
<td class="ltx_td ltx_align_left ltx_eqn_cell"><math id="S3.Ex8.m2.5" class="ltx_Math" alttext="\displaystyle=\text{$\left\{V\!alue:Address\;or\;Address\_Region,...\right\}$}." display="inline"><semantics id="S3.Ex8.m2.5a"><mrow id="S3.Ex8.m2.5.5.1" xref="S3.Ex8.m2.5.5.1.1.cmml"><mrow id="S3.Ex8.m2.5.5.1.1" xref="S3.Ex8.m2.5.5.1.1.cmml"><mi id="S3.Ex8.m2.5.5.1.1.2" xref="S3.Ex8.m2.5.5.1.1.2.cmml"></mi><mo id="S3.Ex8.m2.5.5.1.1.1" xref="S3.Ex8.m2.5.5.1.1.1.cmml">=</mo><mrow id="S3.Ex8.m2.4.4.4" xref="S3.Ex8.m2.4.4.5.cmml"><mo id="S3.Ex8.m2.4.4.4.3" xref="S3.Ex8.m2.4.4.5.1.cmml">{</mo><mrow id="S3.Ex8.m2.3.3.3.1" xref="S3.Ex8.m2.3.3.3.1.cmml"><mpadded width="0.636em"><mi id="S3.Ex8.m2.3.3.3.1.2" xref="S3.Ex8.m2.3.3.3.1.2.cmml">V</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.3.3.3.1.1" xref="S3.Ex8.m2.3.3.3.1.1.cmml">​</mo><mi id="S3.Ex8.m2.3.3.3.1.3" xref="S3.Ex8.m2.3.3.3.1.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.3.3.3.1.1a" xref="S3.Ex8.m2.3.3.3.1.1.cmml">​</mo><mi id="S3.Ex8.m2.3.3.3.1.4" xref="S3.Ex8.m2.3.3.3.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.3.3.3.1.1b" xref="S3.Ex8.m2.3.3.3.1.1.cmml">​</mo><mi id="S3.Ex8.m2.3.3.3.1.5" xref="S3.Ex8.m2.3.3.3.1.5.cmml">u</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.3.3.3.1.1c" xref="S3.Ex8.m2.3.3.3.1.1.cmml">​</mo><mi id="S3.Ex8.m2.3.3.3.1.6" xref="S3.Ex8.m2.3.3.3.1.6.cmml">e</mi></mrow><mo lspace="0.278em" rspace="0.278em" id="S3.Ex8.m2.4.4.4.4" xref="S3.Ex8.m2.4.4.5.1.cmml">:</mo><mrow id="S3.Ex8.m2.4.4.4.2.1" xref="S3.Ex8.m2.4.4.4.2.2.cmml"><mrow id="S3.Ex8.m2.4.4.4.2.1.1" xref="S3.Ex8.m2.4.4.4.2.1.1.cmml"><mi id="S3.Ex8.m2.4.4.4.2.1.1.2" xref="S3.Ex8.m2.4.4.4.2.1.1.2.cmml">A</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.3" xref="S3.Ex8.m2.4.4.4.2.1.1.3.cmml">d</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1a" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.4" xref="S3.Ex8.m2.4.4.4.2.1.1.4.cmml">d</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1b" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.5" xref="S3.Ex8.m2.4.4.4.2.1.1.5.cmml">r</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1c" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.6" xref="S3.Ex8.m2.4.4.4.2.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1d" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.7" xref="S3.Ex8.m2.4.4.4.2.1.1.7.cmml">s</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1e" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.8" xref="S3.Ex8.m2.4.4.4.2.1.1.8.cmml">s</mi><mo lspace="0.280em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1f" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.9" xref="S3.Ex8.m2.4.4.4.2.1.1.9.cmml">o</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1g" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.10" xref="S3.Ex8.m2.4.4.4.2.1.1.10.cmml">r</mi><mo lspace="0.280em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1h" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.11" xref="S3.Ex8.m2.4.4.4.2.1.1.11.cmml">A</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1i" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.12" xref="S3.Ex8.m2.4.4.4.2.1.1.12.cmml">d</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1j" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.13" xref="S3.Ex8.m2.4.4.4.2.1.1.13.cmml">d</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1k" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.14" xref="S3.Ex8.m2.4.4.4.2.1.1.14.cmml">r</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1l" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.15" xref="S3.Ex8.m2.4.4.4.2.1.1.15.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1m" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.16" xref="S3.Ex8.m2.4.4.4.2.1.1.16.cmml">s</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1n" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.17" xref="S3.Ex8.m2.4.4.4.2.1.1.17.cmml">s</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1o" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi mathvariant="normal" id="S3.Ex8.m2.4.4.4.2.1.1.18" xref="S3.Ex8.m2.4.4.4.2.1.1.18.cmml">_</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1p" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.19" xref="S3.Ex8.m2.4.4.4.2.1.1.19.cmml">R</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1q" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.20" xref="S3.Ex8.m2.4.4.4.2.1.1.20.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1r" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.21" xref="S3.Ex8.m2.4.4.4.2.1.1.21.cmml">g</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1s" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.22" xref="S3.Ex8.m2.4.4.4.2.1.1.22.cmml">i</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1t" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.23" xref="S3.Ex8.m2.4.4.4.2.1.1.23.cmml">o</mi><mo lspace="0em" rspace="0em" id="S3.Ex8.m2.4.4.4.2.1.1.1u" xref="S3.Ex8.m2.4.4.4.2.1.1.1.cmml">​</mo><mi id="S3.Ex8.m2.4.4.4.2.1.1.24" xref="S3.Ex8.m2.4.4.4.2.1.1.24.cmml">n</mi></mrow><mo id="S3.Ex8.m2.4.4.4.2.1.2" xref="S3.Ex8.m2.4.4.4.2.2.cmml">,</mo><mi mathvariant="normal" id="S3.Ex8.m2.2.2.2" xref="S3.Ex8.m2.2.2.2.cmml">…</mi></mrow><mo id="S3.Ex8.m2.4.4.4.5" xref="S3.Ex8.m2.4.4.5.1.cmml">}</mo></mrow></mrow><mo lspace="0em" id="S3.Ex8.m2.5.5.1.2" xref="S3.Ex8.m2.5.5.1.1.cmml">.</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex8.m2.5b"><apply id="S3.Ex8.m2.5.5.1.1.cmml" xref="S3.Ex8.m2.5.5.1"><eq id="S3.Ex8.m2.5.5.1.1.1.cmml" xref="S3.Ex8.m2.5.5.1.1.1"></eq><csymbol cd="latexml" id="S3.Ex8.m2.5.5.1.1.2.cmml" xref="S3.Ex8.m2.5.5.1.1.2">absent</csymbol><apply id="S3.Ex8.m2.4.4.5.cmml" xref="S3.Ex8.m2.4.4.4"><csymbol cd="latexml" id="S3.Ex8.m2.4.4.5.1.cmml" xref="S3.Ex8.m2.4.4.4.3">conditional-set</csymbol><apply id="S3.Ex8.m2.3.3.3.1.cmml" xref="S3.Ex8.m2.3.3.3.1"><times id="S3.Ex8.m2.3.3.3.1.1.cmml" xref="S3.Ex8.m2.3.3.3.1.1"></times><ci id="S3.Ex8.m2.3.3.3.1.2.cmml" xref="S3.Ex8.m2.3.3.3.1.2">𝑉</ci><ci id="S3.Ex8.m2.3.3.3.1.3.cmml" xref="S3.Ex8.m2.3.3.3.1.3">𝑎</ci><ci id="S3.Ex8.m2.3.3.3.1.4.cmml" xref="S3.Ex8.m2.3.3.3.1.4">𝑙</ci><ci id="S3.Ex8.m2.3.3.3.1.5.cmml" xref="S3.Ex8.m2.3.3.3.1.5">𝑢</ci><ci id="S3.Ex8.m2.3.3.3.1.6.cmml" xref="S3.Ex8.m2.3.3.3.1.6">𝑒</ci></apply><list id="S3.Ex8.m2.4.4.4.2.2.cmml" xref="S3.Ex8.m2.4.4.4.2.1"><apply id="S3.Ex8.m2.4.4.4.2.1.1.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1"><times id="S3.Ex8.m2.4.4.4.2.1.1.1.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.1"></times><ci id="S3.Ex8.m2.4.4.4.2.1.1.2.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.2">𝐴</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.3.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.3">𝑑</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.4.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.4">𝑑</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.5.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.5">𝑟</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.6.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.6">𝑒</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.7.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.7">𝑠</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.8.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.8">𝑠</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.9.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.9">𝑜</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.10.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.10">𝑟</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.11.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.11">𝐴</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.12.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.12">𝑑</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.13.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.13">𝑑</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.14.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.14">𝑟</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.15.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.15">𝑒</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.16.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.16">𝑠</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.17.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.17">𝑠</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.18.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.18">_</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.19.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.19">𝑅</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.20.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.20">𝑒</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.21.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.21">𝑔</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.22.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.22">𝑖</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.23.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.23">𝑜</ci><ci id="S3.Ex8.m2.4.4.4.2.1.1.24.cmml" xref="S3.Ex8.m2.4.4.4.2.1.1.24">𝑛</ci></apply><ci id="S3.Ex8.m2.2.2.2.cmml" xref="S3.Ex8.m2.2.2.2">…</ci></list></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex8.m2.5c">\displaystyle=\text{$\left\{V\!alue:Address\;or\;Address\_Region,...\right\}$}.</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(6)</span></td>
</tr></tbody>
</table>
</div>
<div id="S3.SS3.p3" class="ltx_para">
<p id="S3.SS3.p3.1" class="ltx_p">Inverted-index Translation is a <span id="S3.SS3.p3.1.1" class="ltx_text ltx_font_bold">lossless compression</span> method general for all spreadsheet understanding tasks, and it remarkably increases <span id="S3.SS3.p3.1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span>’s compression ratio from 4.41 to 14.91. More details can be found in Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>.</p>
</div>
</section>
<section id="S3.SS4" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">3.4 </span>Data-format-aware Aggregation</h3>

<div id="S3.SS4.p1" class="ltx_para">
<p id="S3.SS4.p1.1" class="ltx_p">In spreadsheets, adjacent cells typically share the same data format. As shown in Figure <a href="#S1.F2" title="Figure 2 ‣ 1 Introduction ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> (3), column C records the sell-in billed revenue for different products. Nonetheless, the concrete numerical values are not essential for understanding the structure and semantics of the spreadsheet (although there might loss of fine-trained details of exact quantities, e.g., "18,476" and "18,674", this does not impact our comprehension that this column represents revenue). In contrast, the data type is critical for understanding spreadsheets. On one hand, data types represent fundamental semantic properties, such as "time" or "phone number". It motivates us to implement rules to match the value of the cell to different data types. On the other hand, in contrast to detailed numerical values, identical data types may be compressed through clustering, thereby reducing the number of tokens.</p>
</div>
<div id="S3.SS4.p2" class="ltx_para">
<p id="S3.SS4.p2.2" class="ltx_p">In this section, we introduce Data-format-aware Aggregation for further compression and information integration. Specifically, we employ Number Format String (NFS), which is a built-in cell attribute in spreadsheets. NFSs can be extracted by default using tools like ClosedXML or OpenPyXL, used to describe the format of cell data as a string. For instance, the NFS for "2024.2.14" is "yyyy-mm-dd", indicating a specific <span id="S3.SS4.p2.2.1" class="ltx_text ltx_font_bold">date</span> format. However, spreadsheet users do not always explicitly add NFSs to cells, so NFSs are sometimes absent. As a complement, we propose a rule-based recognizer to map a cell value to a specific predefined data type: Year, Integer, Float, Percentage, Scientific notation, Date, Time, Currency, Email, and Others. The first nine types broadly cover approximately 55% of the cells in our dataset derived from real-world corpora. Finally, based on the NFSs and data type, the aggregator aggregates the cells by Algorithm <a href="#algorithm1" title="In M.1 Identical Cell Aggregation ‣ Appendix M Algorithm Steps ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>.
This process can be represented as follows:</p>
<table id="A13.EGx7" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex9"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex9.m1.5" class="ltx_Math" alttext="\displaystyle N\!F\!S\!s=\mathrm{nfs}(\left\{Cell_{i,j}\right\}_{i\in m,j\in n})," display="inline"><semantics id="S3.Ex9.m1.5a"><mrow id="S3.Ex9.m1.5.5.1" xref="S3.Ex9.m1.5.5.1.1.cmml"><mrow id="S3.Ex9.m1.5.5.1.1" xref="S3.Ex9.m1.5.5.1.1.cmml"><mrow id="S3.Ex9.m1.5.5.1.1.3" xref="S3.Ex9.m1.5.5.1.1.3.cmml"><mpadded width="0.742em"><mi id="S3.Ex9.m1.5.5.1.1.3.2" xref="S3.Ex9.m1.5.5.1.1.3.2.cmml">N</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.3.1" xref="S3.Ex9.m1.5.5.1.1.3.1.cmml">​</mo><mpadded width="0.612em"><mi id="S3.Ex9.m1.5.5.1.1.3.3" xref="S3.Ex9.m1.5.5.1.1.3.3.cmml">F</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.3.1a" xref="S3.Ex9.m1.5.5.1.1.3.1.cmml">​</mo><mpadded width="0.501em"><mi id="S3.Ex9.m1.5.5.1.1.3.4" xref="S3.Ex9.m1.5.5.1.1.3.4.cmml">S</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.3.1b" xref="S3.Ex9.m1.5.5.1.1.3.1.cmml">​</mo><mi id="S3.Ex9.m1.5.5.1.1.3.5" xref="S3.Ex9.m1.5.5.1.1.3.5.cmml">s</mi></mrow><mo id="S3.Ex9.m1.5.5.1.1.2" xref="S3.Ex9.m1.5.5.1.1.2.cmml">=</mo><mrow id="S3.Ex9.m1.5.5.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.cmml"><mi id="S3.Ex9.m1.5.5.1.1.1.3" xref="S3.Ex9.m1.5.5.1.1.1.3.cmml">nfs</mi><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.1.2" xref="S3.Ex9.m1.5.5.1.1.1.2.cmml">​</mo><mrow id="S3.Ex9.m1.5.5.1.1.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.cmml"><mo stretchy="false" id="S3.Ex9.m1.5.5.1.1.1.1.1.2" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.cmml">(</mo><msub id="S3.Ex9.m1.5.5.1.1.1.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.cmml"><mrow id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.2.cmml"><mo id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.2" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.2.cmml">{</mo><mrow id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.cmml"><mi id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.2" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.3" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1a" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.4" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1b" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><msub id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.cmml"><mi id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.2" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.Ex9.m1.2.2.2.4" xref="S3.Ex9.m1.2.2.2.3.cmml"><mi id="S3.Ex9.m1.1.1.1.1" xref="S3.Ex9.m1.1.1.1.1.cmml">i</mi><mo id="S3.Ex9.m1.2.2.2.4.1" xref="S3.Ex9.m1.2.2.2.3.cmml">,</mo><mi id="S3.Ex9.m1.2.2.2.2" xref="S3.Ex9.m1.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.3" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.2.cmml">}</mo></mrow><mrow id="S3.Ex9.m1.4.4.2.2" xref="S3.Ex9.m1.4.4.2.3.cmml"><mrow id="S3.Ex9.m1.3.3.1.1.1" xref="S3.Ex9.m1.3.3.1.1.1.cmml"><mi id="S3.Ex9.m1.3.3.1.1.1.2" xref="S3.Ex9.m1.3.3.1.1.1.2.cmml">i</mi><mo id="S3.Ex9.m1.3.3.1.1.1.1" xref="S3.Ex9.m1.3.3.1.1.1.1.cmml">∈</mo><mi id="S3.Ex9.m1.3.3.1.1.1.3" xref="S3.Ex9.m1.3.3.1.1.1.3.cmml">m</mi></mrow><mo id="S3.Ex9.m1.4.4.2.2.3" xref="S3.Ex9.m1.4.4.2.3a.cmml">,</mo><mrow id="S3.Ex9.m1.4.4.2.2.2" xref="S3.Ex9.m1.4.4.2.2.2.cmml"><mi id="S3.Ex9.m1.4.4.2.2.2.2" xref="S3.Ex9.m1.4.4.2.2.2.2.cmml">j</mi><mo id="S3.Ex9.m1.4.4.2.2.2.1" xref="S3.Ex9.m1.4.4.2.2.2.1.cmml">∈</mo><mi id="S3.Ex9.m1.4.4.2.2.2.3" xref="S3.Ex9.m1.4.4.2.2.2.3.cmml">n</mi></mrow></mrow></msub><mo stretchy="false" id="S3.Ex9.m1.5.5.1.1.1.1.1.3" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.cmml">)</mo></mrow></mrow></mrow><mo id="S3.Ex9.m1.5.5.1.2" xref="S3.Ex9.m1.5.5.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex9.m1.5b"><apply id="S3.Ex9.m1.5.5.1.1.cmml" xref="S3.Ex9.m1.5.5.1"><eq id="S3.Ex9.m1.5.5.1.1.2.cmml" xref="S3.Ex9.m1.5.5.1.1.2"></eq><apply id="S3.Ex9.m1.5.5.1.1.3.cmml" xref="S3.Ex9.m1.5.5.1.1.3"><times id="S3.Ex9.m1.5.5.1.1.3.1.cmml" xref="S3.Ex9.m1.5.5.1.1.3.1"></times><ci id="S3.Ex9.m1.5.5.1.1.3.2.cmml" xref="S3.Ex9.m1.5.5.1.1.3.2">𝑁</ci><ci id="S3.Ex9.m1.5.5.1.1.3.3.cmml" xref="S3.Ex9.m1.5.5.1.1.3.3">𝐹</ci><ci id="S3.Ex9.m1.5.5.1.1.3.4.cmml" xref="S3.Ex9.m1.5.5.1.1.3.4">𝑆</ci><ci id="S3.Ex9.m1.5.5.1.1.3.5.cmml" xref="S3.Ex9.m1.5.5.1.1.3.5">𝑠</ci></apply><apply id="S3.Ex9.m1.5.5.1.1.1.cmml" xref="S3.Ex9.m1.5.5.1.1.1"><times id="S3.Ex9.m1.5.5.1.1.1.2.cmml" xref="S3.Ex9.m1.5.5.1.1.1.2"></times><ci id="S3.Ex9.m1.5.5.1.1.1.3.cmml" xref="S3.Ex9.m1.5.5.1.1.1.3">nfs</ci><apply id="S3.Ex9.m1.5.5.1.1.1.1.1.1.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1"><csymbol cd="ambiguous" id="S3.Ex9.m1.5.5.1.1.1.1.1.1.2.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1">subscript</csymbol><set id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.2.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1"><apply id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1"><times id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.1"></times><ci id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.2.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.2">𝐶</ci><ci id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.3.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.3">𝑒</ci><ci id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.4.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.4">𝑙</ci><apply id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.1.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5">subscript</csymbol><ci id="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.2.cmml" xref="S3.Ex9.m1.5.5.1.1.1.1.1.1.1.1.1.5.2">𝑙</ci><list id="S3.Ex9.m1.2.2.2.3.cmml" xref="S3.Ex9.m1.2.2.2.4"><ci id="S3.Ex9.m1.1.1.1.1.cmml" xref="S3.Ex9.m1.1.1.1.1">𝑖</ci><ci id="S3.Ex9.m1.2.2.2.2.cmml" xref="S3.Ex9.m1.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.Ex9.m1.4.4.2.3.cmml" xref="S3.Ex9.m1.4.4.2.2"><csymbol cd="ambiguous" id="S3.Ex9.m1.4.4.2.3a.cmml" xref="S3.Ex9.m1.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.Ex9.m1.3.3.1.1.1.cmml" xref="S3.Ex9.m1.3.3.1.1.1"><in id="S3.Ex9.m1.3.3.1.1.1.1.cmml" xref="S3.Ex9.m1.3.3.1.1.1.1"></in><ci id="S3.Ex9.m1.3.3.1.1.1.2.cmml" xref="S3.Ex9.m1.3.3.1.1.1.2">𝑖</ci><ci id="S3.Ex9.m1.3.3.1.1.1.3.cmml" xref="S3.Ex9.m1.3.3.1.1.1.3">𝑚</ci></apply><apply id="S3.Ex9.m1.4.4.2.2.2.cmml" xref="S3.Ex9.m1.4.4.2.2.2"><in id="S3.Ex9.m1.4.4.2.2.2.1.cmml" xref="S3.Ex9.m1.4.4.2.2.2.1"></in><ci id="S3.Ex9.m1.4.4.2.2.2.2.cmml" xref="S3.Ex9.m1.4.4.2.2.2.2">𝑗</ci><ci id="S3.Ex9.m1.4.4.2.2.2.3.cmml" xref="S3.Ex9.m1.4.4.2.2.2.3">𝑛</ci></apply></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex9.m1.5c">\displaystyle N\!F\!S\!s=\mathrm{nfs}(\left\{Cell_{i,j}\right\}_{i\in m,j\in n}),</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(7)</span></td>
</tr></tbody>
</table>
<table id="A13.EGx8" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S3.Ex10"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S3.Ex10.m1.6" class="ltx_Math" alttext="\displaystyle\mathcal{T}_{a}=\mathrm{aggregator}(\left\{Cell_{i,j}\right\}_{i\in m,j\in n},N\!F\!S\!s,R)," display="inline"><semantics id="S3.Ex10.m1.6a"><mrow id="S3.Ex10.m1.6.6.1" xref="S3.Ex10.m1.6.6.1.1.cmml"><mrow id="S3.Ex10.m1.6.6.1.1" xref="S3.Ex10.m1.6.6.1.1.cmml"><msub id="S3.Ex10.m1.6.6.1.1.4" xref="S3.Ex10.m1.6.6.1.1.4.cmml"><mi class="ltx_font_mathcaligraphic" id="S3.Ex10.m1.6.6.1.1.4.2" xref="S3.Ex10.m1.6.6.1.1.4.2.cmml">𝒯</mi><mi id="S3.Ex10.m1.6.6.1.1.4.3" xref="S3.Ex10.m1.6.6.1.1.4.3.cmml">a</mi></msub><mo id="S3.Ex10.m1.6.6.1.1.3" xref="S3.Ex10.m1.6.6.1.1.3.cmml">=</mo><mrow id="S3.Ex10.m1.6.6.1.1.2" xref="S3.Ex10.m1.6.6.1.1.2.cmml"><mi id="S3.Ex10.m1.6.6.1.1.2.4" xref="S3.Ex10.m1.6.6.1.1.2.4.cmml">aggregator</mi><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.2.3" xref="S3.Ex10.m1.6.6.1.1.2.3.cmml">​</mo><mrow id="S3.Ex10.m1.6.6.1.1.2.2.2" xref="S3.Ex10.m1.6.6.1.1.2.2.3.cmml"><mo stretchy="false" id="S3.Ex10.m1.6.6.1.1.2.2.2.3" xref="S3.Ex10.m1.6.6.1.1.2.2.3.cmml">(</mo><msub id="S3.Ex10.m1.6.6.1.1.1.1.1.1" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.cmml"><mrow id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.2.cmml"><mo id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.2" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.2.cmml">{</mo><mrow id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.cmml"><mi id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.2" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.2.cmml">C</mi><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.3" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1a" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><mi id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.4" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1b" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1.cmml">​</mo><msub id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.cmml"><mi id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.2" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.2.cmml">l</mi><mrow id="S3.Ex10.m1.2.2.2.4" xref="S3.Ex10.m1.2.2.2.3.cmml"><mi id="S3.Ex10.m1.1.1.1.1" xref="S3.Ex10.m1.1.1.1.1.cmml">i</mi><mo id="S3.Ex10.m1.2.2.2.4.1" xref="S3.Ex10.m1.2.2.2.3.cmml">,</mo><mi id="S3.Ex10.m1.2.2.2.2" xref="S3.Ex10.m1.2.2.2.2.cmml">j</mi></mrow></msub></mrow><mo id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.3" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.2.cmml">}</mo></mrow><mrow id="S3.Ex10.m1.4.4.2.2" xref="S3.Ex10.m1.4.4.2.3.cmml"><mrow id="S3.Ex10.m1.3.3.1.1.1" xref="S3.Ex10.m1.3.3.1.1.1.cmml"><mi id="S3.Ex10.m1.3.3.1.1.1.2" xref="S3.Ex10.m1.3.3.1.1.1.2.cmml">i</mi><mo id="S3.Ex10.m1.3.3.1.1.1.1" xref="S3.Ex10.m1.3.3.1.1.1.1.cmml">∈</mo><mi id="S3.Ex10.m1.3.3.1.1.1.3" xref="S3.Ex10.m1.3.3.1.1.1.3.cmml">m</mi></mrow><mo id="S3.Ex10.m1.4.4.2.2.3" xref="S3.Ex10.m1.4.4.2.3a.cmml">,</mo><mrow id="S3.Ex10.m1.4.4.2.2.2" xref="S3.Ex10.m1.4.4.2.2.2.cmml"><mi id="S3.Ex10.m1.4.4.2.2.2.2" xref="S3.Ex10.m1.4.4.2.2.2.2.cmml">j</mi><mo id="S3.Ex10.m1.4.4.2.2.2.1" xref="S3.Ex10.m1.4.4.2.2.2.1.cmml">∈</mo><mi id="S3.Ex10.m1.4.4.2.2.2.3" xref="S3.Ex10.m1.4.4.2.2.2.3.cmml">n</mi></mrow></mrow></msub><mo id="S3.Ex10.m1.6.6.1.1.2.2.2.4" xref="S3.Ex10.m1.6.6.1.1.2.2.3.cmml">,</mo><mrow id="S3.Ex10.m1.6.6.1.1.2.2.2.2" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.cmml"><mpadded width="0.742em"><mi id="S3.Ex10.m1.6.6.1.1.2.2.2.2.2" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.2.cmml">N</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.2.2.2.2.1" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.1.cmml">​</mo><mpadded width="0.612em"><mi id="S3.Ex10.m1.6.6.1.1.2.2.2.2.3" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.3.cmml">F</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.2.2.2.2.1a" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.1.cmml">​</mo><mpadded width="0.501em"><mi id="S3.Ex10.m1.6.6.1.1.2.2.2.2.4" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.4.cmml">S</mi></mpadded><mo lspace="0em" rspace="0em" id="S3.Ex10.m1.6.6.1.1.2.2.2.2.1b" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.1.cmml">​</mo><mi id="S3.Ex10.m1.6.6.1.1.2.2.2.2.5" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.5.cmml">s</mi></mrow><mo id="S3.Ex10.m1.6.6.1.1.2.2.2.5" xref="S3.Ex10.m1.6.6.1.1.2.2.3.cmml">,</mo><mi id="S3.Ex10.m1.5.5" xref="S3.Ex10.m1.5.5.cmml">R</mi><mo stretchy="false" id="S3.Ex10.m1.6.6.1.1.2.2.2.6" xref="S3.Ex10.m1.6.6.1.1.2.2.3.cmml">)</mo></mrow></mrow></mrow><mo id="S3.Ex10.m1.6.6.1.2" xref="S3.Ex10.m1.6.6.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S3.Ex10.m1.6b"><apply id="S3.Ex10.m1.6.6.1.1.cmml" xref="S3.Ex10.m1.6.6.1"><eq id="S3.Ex10.m1.6.6.1.1.3.cmml" xref="S3.Ex10.m1.6.6.1.1.3"></eq><apply id="S3.Ex10.m1.6.6.1.1.4.cmml" xref="S3.Ex10.m1.6.6.1.1.4"><csymbol cd="ambiguous" id="S3.Ex10.m1.6.6.1.1.4.1.cmml" xref="S3.Ex10.m1.6.6.1.1.4">subscript</csymbol><ci id="S3.Ex10.m1.6.6.1.1.4.2.cmml" xref="S3.Ex10.m1.6.6.1.1.4.2">𝒯</ci><ci id="S3.Ex10.m1.6.6.1.1.4.3.cmml" xref="S3.Ex10.m1.6.6.1.1.4.3">𝑎</ci></apply><apply id="S3.Ex10.m1.6.6.1.1.2.cmml" xref="S3.Ex10.m1.6.6.1.1.2"><times id="S3.Ex10.m1.6.6.1.1.2.3.cmml" xref="S3.Ex10.m1.6.6.1.1.2.3"></times><ci id="S3.Ex10.m1.6.6.1.1.2.4.cmml" xref="S3.Ex10.m1.6.6.1.1.2.4">aggregator</ci><vector id="S3.Ex10.m1.6.6.1.1.2.2.3.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2"><apply id="S3.Ex10.m1.6.6.1.1.1.1.1.1.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1"><csymbol cd="ambiguous" id="S3.Ex10.m1.6.6.1.1.1.1.1.1.2.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1">subscript</csymbol><set id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.2.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1"><apply id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1"><times id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.1"></times><ci id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.2.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.2">𝐶</ci><ci id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.3.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.3">𝑒</ci><ci id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.4.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.4">𝑙</ci><apply id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5"><csymbol cd="ambiguous" id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.1.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5">subscript</csymbol><ci id="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.2.cmml" xref="S3.Ex10.m1.6.6.1.1.1.1.1.1.1.1.1.5.2">𝑙</ci><list id="S3.Ex10.m1.2.2.2.3.cmml" xref="S3.Ex10.m1.2.2.2.4"><ci id="S3.Ex10.m1.1.1.1.1.cmml" xref="S3.Ex10.m1.1.1.1.1">𝑖</ci><ci id="S3.Ex10.m1.2.2.2.2.cmml" xref="S3.Ex10.m1.2.2.2.2">𝑗</ci></list></apply></apply></set><apply id="S3.Ex10.m1.4.4.2.3.cmml" xref="S3.Ex10.m1.4.4.2.2"><csymbol cd="ambiguous" id="S3.Ex10.m1.4.4.2.3a.cmml" xref="S3.Ex10.m1.4.4.2.2.3">formulae-sequence</csymbol><apply id="S3.Ex10.m1.3.3.1.1.1.cmml" xref="S3.Ex10.m1.3.3.1.1.1"><in id="S3.Ex10.m1.3.3.1.1.1.1.cmml" xref="S3.Ex10.m1.3.3.1.1.1.1"></in><ci id="S3.Ex10.m1.3.3.1.1.1.2.cmml" xref="S3.Ex10.m1.3.3.1.1.1.2">𝑖</ci><ci id="S3.Ex10.m1.3.3.1.1.1.3.cmml" xref="S3.Ex10.m1.3.3.1.1.1.3">𝑚</ci></apply><apply id="S3.Ex10.m1.4.4.2.2.2.cmml" xref="S3.Ex10.m1.4.4.2.2.2"><in id="S3.Ex10.m1.4.4.2.2.2.1.cmml" xref="S3.Ex10.m1.4.4.2.2.2.1"></in><ci id="S3.Ex10.m1.4.4.2.2.2.2.cmml" xref="S3.Ex10.m1.4.4.2.2.2.2">𝑗</ci><ci id="S3.Ex10.m1.4.4.2.2.2.3.cmml" xref="S3.Ex10.m1.4.4.2.2.2.3">𝑛</ci></apply></apply></apply><apply id="S3.Ex10.m1.6.6.1.1.2.2.2.2.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2"><times id="S3.Ex10.m1.6.6.1.1.2.2.2.2.1.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.1"></times><ci id="S3.Ex10.m1.6.6.1.1.2.2.2.2.2.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.2">𝑁</ci><ci id="S3.Ex10.m1.6.6.1.1.2.2.2.2.3.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.3">𝐹</ci><ci id="S3.Ex10.m1.6.6.1.1.2.2.2.2.4.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.4">𝑆</ci><ci id="S3.Ex10.m1.6.6.1.1.2.2.2.2.5.cmml" xref="S3.Ex10.m1.6.6.1.1.2.2.2.2.5">𝑠</ci></apply><ci id="S3.Ex10.m1.5.5.cmml" xref="S3.Ex10.m1.5.5">𝑅</ci></vector></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S3.Ex10.m1.6c">\displaystyle\mathcal{T}_{a}=\mathrm{aggregator}(\left\{Cell_{i,j}\right\}_{i\in m,j\in n},N\!F\!S\!s,R),</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(8)</span></td>
</tr></tbody>
</table>
<p id="S3.SS4.p2.1" class="ltx_p">where <math id="S3.SS4.p2.1.m1.1" class="ltx_Math" alttext="R" display="inline"><semantics id="S3.SS4.p2.1.m1.1a"><mi id="S3.SS4.p2.1.m1.1.1" xref="S3.SS4.p2.1.m1.1.1.cmml">R</mi><annotation-xml encoding="MathML-Content" id="S3.SS4.p2.1.m1.1b"><ci id="S3.SS4.p2.1.m1.1.1.cmml" xref="S3.SS4.p2.1.m1.1.1">𝑅</ci></annotation-xml><annotation encoding="application/x-tex" id="S3.SS4.p2.1.m1.1c">R</annotation></semantics></math> denotes the predefined rules as detailed above. In this way, we further reduce the number of tokens. The compression ratio of the data regions also increases from 14.91 to 24.79. More detailed compression effects of different modules are displayed in Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>.</p>
</div>
</section>
<section id="S3.SS5" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">3.5 </span>Chain of Spreadsheet</h3>

<div id="S3.SS5.p1" class="ltx_para">
<p id="S3.SS5.p1.1" class="ltx_p">To extend the applicability of <span id="S3.SS5.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> to a broader range of downstream tasks, we introduce the Chain of Spreadsheet (CoS), which unfolds two stages:</p>
</div>
<section id="S3.SS5.SSS0.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Table Identification and Boundary Detection</h5>

<div id="S3.SS5.SSS0.Px1.p1" class="ltx_para">
<p id="S3.SS5.SSS0.Px1.p1.1" class="ltx_p">Initially, the compressed spreadsheet and the specific task query are input into the LLM. Leveraging the advances in spreadsheet table detection, the model identifies the table that is relevant to the query and determines the precise boundaries of the relevant content. This step ensures that only pertinent data is considered in the subsequent analysis, optimizing the processing efficiency and focus.</p>
</div>
</section>
<section id="S3.SS5.SSS0.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Response Generation</h5>

<div id="S3.SS5.SSS0.Px2.p1" class="ltx_para">
<p id="S3.SS5.SSS0.Px2.p1.1" class="ltx_p">The query and the identified table section are re-input into the LLM. The model then processes this information to generate an accurate response to the query.</p>
</div>
<div id="S3.SS5.SSS0.Px2.p2" class="ltx_para">
<p id="S3.SS5.SSS0.Px2.p2.1" class="ltx_p">Through the CoS, <span id="S3.SS5.SSS0.Px2.p2.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> effectively handles complex spreadsheets by breaking down the process into manageable parts, thus enabling precise and context-aware responses. In this paper, we validate the effect of the Spreadsheet QA task, which is detailed in Section <a href="#S4.SS2" title="4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.2</span></a>.</p>
</div>
</section>
</section>
</section>
<section id="S4" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">4 </span>Experiments</h2>

<div id="S4.p1" class="ltx_para">
<p id="S4.p1.1" class="ltx_p">In our experimental evaluation, we first verified the effectiveness of our method in spreadsheet understanding. For this purpose, we chose the classic and foundational task of spreadsheet table detection <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>)</cite>. This task serves as a critical benchmark for assessing the framework’s ability to accurately identify and interpret table structures within spreadsheets. Building upon this foundational understanding, we further explored the applicability of our method to downstream applications by selecting the representative task of spreadsheet QA. This allows us to test the model’s capability to not only detect but also comprehend and respond to user queries based on the data and structure identified in the spreadsheets.</p>
</div>
<section id="S4.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.1 </span>Spreadsheet Table Detection</h3>

<section id="S4.SS1.SSS1" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">4.1.1 </span>Dataset</h4>

<div id="S4.SS1.SSS1.p1" class="ltx_para">
<p id="S4.SS1.SSS1.p1.1" class="ltx_p">We used the dataset introduced by <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>)</cite>, a benchmark dataset of real-world spreadsheets with annotated table boundaries. Due to the complexity and ambiguity of precise address labeling (the Fleiss Kappa on the test set is 0.830), we further implemented the quality improvement pipeline on the test set by five human professions, as detailed n in Appendix <a href="#A5" title="Appendix E Spreadsheet Table Detection Test Dataset Quality Improvement Pipeline ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">E</span></a>. To this end, we obtained a highly validated test set containing 188 spreadsheets. Based on the token usage of the vanilla encoding method, we divided the test set into four categories: Small, Medium, Large, and Huge, with a partition of 64:32:70:22. More details are shown in Appendix <a href="#A6" title="Appendix F Spreadsheet Table Detection Test Dataset Partition ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">F</span></a>. We adopted the Error-of-Boundary 0 (EoB-0) metric for evaluation on 188 spreadsheets with 311 tables. EoB-0 requires <span id="S4.SS1.SSS1.p1.1.1" class="ltx_text ltx_font_bold">exact match</span> of the top, left, bottom, and right boundaries.</p>
</div>
</section>
<section id="S4.SS1.SSS2" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">4.1.2 </span>Experiment Setup</h4>

<section id="S4.SS1.SSS2.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Baseline &amp; Evaluation Metrics</h5>

<div id="S4.SS1.SSS2.Px1.p1" class="ltx_para">
<p id="S4.SS1.SSS2.Px1.p1.1" class="ltx_p">To evaluate the performance of <span id="S4.SS1.SSS2.Px1.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>, we chose TableSense-CNN <cite class="ltx_cite ltx_citemacro_cite">Dong et al. (<a href="#bib.bib13" title="" class="ltx_ref">2019b</a>)</cite> as the baseline due to its previously demonstrated effectiveness in spreadsheet table detection task. We employed the F1 Score as the primary metric to evaluate and compare the performance of different models, as it balances precision and recall, providing a holistic view of model accuracy.</p>
</div>
</section>
<section id="S4.SS1.SSS2.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Model Selection</h5>

<div id="S4.SS1.SSS2.Px2.p1" class="ltx_para">
<p id="S4.SS1.SSS2.Px2.p1.1" class="ltx_p">The experiments included both closed-source and open-source models. From the closed-source spectrum, we selected two versions of OpenAI’s models: GPT4 and GPT3.5, which are known for their advanced language understanding capabilities. On the open-source side, we chose Llama2, Llama3, Phi3, and Mistral-v2. The specific configurations are detailed in Appendix <a href="#A7" title="Appendix G Experiment Setup ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">G</span></a>.</p>
</div>
</section>
</section>
</section>
<section id="S4.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.2 </span>Spreadsheet QA</h3>

<section id="S4.SS2.SSS1" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">4.2.1 </span>Dataset</h4>

<div id="S4.SS2.SSS1.p1" class="ltx_para">
<p id="S4.SS2.SSS1.p1.1" class="ltx_p">Existing datasets for the Table QA task focus solely on single-table scenarios, leaving a notable gap in performance evaluation for spreadsheets that contain multiple tables. To bridge this gap, we developed a new Spreadsheet QA dataset tailored to the complexities of multi-table environments. We sampled is better 64 spreadsheets from our larger collection and crafted 4-6 questions per spreadsheet, targeting fundamental operations such as searching, comparison, and basic arithmetic. We deliberately excluded questions involving composite operations to maintain clarity and focus in testing specific skills. Each question was paired with an answer, formatted either as a specific cell address or a formula that includes cell addresses, facilitating direct and unambiguous evaluations of the model’s ability to navigate and interpret spreadsheet data. This approach resulted in a comprehensive test dataset comprising 307 items, each a tuple of <math id="S4.SS2.SSS1.p1.1.m1.3" class="ltx_Math" alttext="(Q,A,S)" display="inline"><semantics id="S4.SS2.SSS1.p1.1.m1.3a"><mrow id="S4.SS2.SSS1.p1.1.m1.3.4.2" xref="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml"><mo stretchy="false" id="S4.SS2.SSS1.p1.1.m1.3.4.2.1" xref="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml">(</mo><mi id="S4.SS2.SSS1.p1.1.m1.1.1" xref="S4.SS2.SSS1.p1.1.m1.1.1.cmml">Q</mi><mo id="S4.SS2.SSS1.p1.1.m1.3.4.2.2" xref="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml">,</mo><mi id="S4.SS2.SSS1.p1.1.m1.2.2" xref="S4.SS2.SSS1.p1.1.m1.2.2.cmml">A</mi><mo id="S4.SS2.SSS1.p1.1.m1.3.4.2.3" xref="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml">,</mo><mi id="S4.SS2.SSS1.p1.1.m1.3.3" xref="S4.SS2.SSS1.p1.1.m1.3.3.cmml">S</mi><mo stretchy="false" id="S4.SS2.SSS1.p1.1.m1.3.4.2.4" xref="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml">)</mo></mrow><annotation-xml encoding="MathML-Content" id="S4.SS2.SSS1.p1.1.m1.3b"><vector id="S4.SS2.SSS1.p1.1.m1.3.4.1.cmml" xref="S4.SS2.SSS1.p1.1.m1.3.4.2"><ci id="S4.SS2.SSS1.p1.1.m1.1.1.cmml" xref="S4.SS2.SSS1.p1.1.m1.1.1">𝑄</ci><ci id="S4.SS2.SSS1.p1.1.m1.2.2.cmml" xref="S4.SS2.SSS1.p1.1.m1.2.2">𝐴</ci><ci id="S4.SS2.SSS1.p1.1.m1.3.3.cmml" xref="S4.SS2.SSS1.p1.1.m1.3.3">𝑆</ci></vector></annotation-xml><annotation encoding="application/x-tex" id="S4.SS2.SSS1.p1.1.m1.3c">(Q,A,S)</annotation></semantics></math>, which is detailed in Appendix <a href="#A8" title="Appendix H Spreadsheet QA Test Dataset ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">H</span></a>.</p>
</div>
<figure id="S4.T1" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 1: </span>Average Compression Ratio on test datasets. Results of the train &amp; valid set are shown in Appendix <a href="#A10.SS1" title="J.1 Compression Results ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">J.1</span></a>.</figcaption>
<div id="S4.T1.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:427.3pt;height:40.1pt;vertical-align:-0.7pt;"><span class="ltx_transformed_inner" style="transform:translate(-79.0pt,7.3pt) scale(0.73,0.73) ;">
<table id="S4.T1.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="S4.T1.1.1.1.1" class="ltx_tr">
<th id="S4.T1.1.1.1.1.1" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Metric</th>
<th id="S4.T1.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">No Modules</th>
<th id="S4.T1.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1</th>
<th id="S4.T1.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 2</th>
<th id="S4.T1.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 3</th>
<th id="S4.T1.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1&amp;2</th>
<th id="S4.T1.1.1.1.1.7" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1&amp;3</th>
<th id="S4.T1.1.1.1.1.8" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 2&amp;3</th>
<th id="S4.T1.1.1.1.1.9" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1&amp;2&amp;3</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="S4.T1.1.1.2.1" class="ltx_tr">
<th id="S4.T1.1.1.2.1.1" class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_r ltx_border_t">Total Tokens</th>
<td id="S4.T1.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">1,548,577</td>
<td id="S4.T1.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">350,946</td>
<td id="S4.T1.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">580,912</td>
<td id="S4.T1.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">213,890</td>
<td id="S4.T1.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">103,880</td>
<td id="S4.T1.1.1.2.1.7" class="ltx_td ltx_align_center ltx_border_t">96,365</td>
<td id="S4.T1.1.1.2.1.8" class="ltx_td ltx_align_center ltx_border_t">211,445</td>
<td id="S4.T1.1.1.2.1.9" class="ltx_td ltx_align_center ltx_border_t">62,469</td>
</tr>
<tr id="S4.T1.1.1.3.2" class="ltx_tr">
<th id="S4.T1.1.1.3.2.1" class="ltx_td ltx_align_center ltx_th ltx_th_row ltx_border_bb ltx_border_r">Compress Ratio</th>
<td id="S4.T1.1.1.3.2.2" class="ltx_td ltx_align_center ltx_border_bb">1.00</td>
<td id="S4.T1.1.1.3.2.3" class="ltx_td ltx_align_center ltx_border_bb">4.41</td>
<td id="S4.T1.1.1.3.2.4" class="ltx_td ltx_align_center ltx_border_bb">2.67</td>
<td id="S4.T1.1.1.3.2.5" class="ltx_td ltx_align_center ltx_border_bb">7.24</td>
<td id="S4.T1.1.1.3.2.6" class="ltx_td ltx_align_center ltx_border_bb">14.91</td>
<td id="S4.T1.1.1.3.2.7" class="ltx_td ltx_align_center ltx_border_bb">16.07</td>
<td id="S4.T1.1.1.3.2.8" class="ltx_td ltx_align_center ltx_border_bb">7.32</td>
<td id="S4.T1.1.1.3.2.9" class="ltx_td ltx_align_center ltx_border_bb">24.79</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="S4.SS2.SSS2" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">4.2.2 </span>Experiment Setup</h4>

<section id="S4.SS2.SSS2.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Baseline &amp; Evaluation Metrics</h5>

<div id="S4.SS2.SSS2.Px1.p1" class="ltx_para">
<p id="S4.SS2.SSS2.Px1.p1.1" class="ltx_p">Given that LLMs have not yet been systematically applied to Spreadsheet QA tasks, we have selected <span id="S4.SS2.SSS2.Px1.p1.1.1" class="ltx_text ltx_font_smallcaps">TaPEx</span> and Binder <cite class="ltx_cite ltx_citemacro_cite">Herzig et al. (<a href="#bib.bib19" title="" class="ltx_ref">2020</a>); Cheng et al. (<a href="#bib.bib7" title="" class="ltx_ref">2022</a>)</cite>, which are established baselines in the Table QA domain, for comparative evaluation. Since <span id="S4.SS2.SSS2.Px1.p1.1.2" class="ltx_text ltx_font_smallcaps">TaPEx</span> and Binder are designed primarily for single-table data, we adapted them for our multi-table context. Initially, our fine-tuned model identifies table regions relevant to each question. These regions are then formatted and fed into the baseline models. In cases where the input exceeds the token limitations of the baseline models, truncation is employed. The accuracy of the answers is assessed based on the correctness of the cell addresses and cell combinations/calculations provided in the answers.</p>
</div>
</section>
<section id="S4.SS2.SSS2.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Model Selection</h5>

<div id="S4.SS2.SSS2.Px2.p1" class="ltx_para">
<p id="S4.SS2.SSS2.Px2.p1.1" class="ltx_p">Our experiments were conducted using the GPT4 model, leveraging its advanced capabilities in language understanding and reasoning. Details on parameters and configurations used are documented in Appendix <a href="#A7" title="Appendix G Experiment Setup ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">G</span></a>.</p>
</div>
</section>
</section>
<section id="S4.SS2.SSS3" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">4.2.3 </span>Experiment Procedure</h4>

<div id="S4.SS2.SSS3.p1" class="ltx_para">
<p id="S4.SS2.SSS3.p1.1" class="ltx_p">In this section, we employed the model fine-tuned on the spreadsheet table detection task to conduct QA experiments. The procedure followed the CoS described in section <a href="#S3.SS5" title="3.5 Chain of Spreadsheet ‣ 3 Method ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3.5</span></a>. Particularly, for instances where the related table was still too large to process effectively, we applied further compression techniques. In cases where tables were exceptionally large and defy effective compression, we utilized a table-splitting algorithm designed to recognize headers and perform strategic concatenation, ensuring that each segment of the split table retains as much contextual integrity as possible. The specifics of this algorithm are detailed in Appendix <a href="#A13.SS2" title="M.2 Table Split QA Algorithm ‣ Appendix M Algorithm Steps ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">M.2</span></a>.</p>
</div>
</section>
</section>
</section>
<section id="S5" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">5 </span>Results</h2>

<section id="S5.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">5.1 </span>Compression Ratio</h3>

<div id="S5.SS1.p1" class="ltx_para">
<p id="S5.SS1.p1.2" class="ltx_p">The effectiveness of our encoding process in reducing the size of spreadsheet data is quantitatively assessed using the compression ratio, which is defined by the formula:</p>
<table id="A13.EGx9" class="ltx_equationgroup ltx_eqn_align ltx_eqn_table">

<tbody id="S5.Ex11"><tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_td ltx_align_right ltx_eqn_cell"><math id="S5.Ex11.m1.1" class="ltx_Math" alttext="\displaystyle r=n/n^{\prime}," display="inline"><semantics id="S5.Ex11.m1.1a"><mrow id="S5.Ex11.m1.1.1.1" xref="S5.Ex11.m1.1.1.1.1.cmml"><mrow id="S5.Ex11.m1.1.1.1.1" xref="S5.Ex11.m1.1.1.1.1.cmml"><mi id="S5.Ex11.m1.1.1.1.1.2" xref="S5.Ex11.m1.1.1.1.1.2.cmml">r</mi><mo id="S5.Ex11.m1.1.1.1.1.1" xref="S5.Ex11.m1.1.1.1.1.1.cmml">=</mo><mrow id="S5.Ex11.m1.1.1.1.1.3" xref="S5.Ex11.m1.1.1.1.1.3.cmml"><mi id="S5.Ex11.m1.1.1.1.1.3.2" xref="S5.Ex11.m1.1.1.1.1.3.2.cmml">n</mi><mo id="S5.Ex11.m1.1.1.1.1.3.1" xref="S5.Ex11.m1.1.1.1.1.3.1.cmml">/</mo><msup id="S5.Ex11.m1.1.1.1.1.3.3" xref="S5.Ex11.m1.1.1.1.1.3.3.cmml"><mi id="S5.Ex11.m1.1.1.1.1.3.3.2" xref="S5.Ex11.m1.1.1.1.1.3.3.2.cmml">n</mi><mo id="S5.Ex11.m1.1.1.1.1.3.3.3" xref="S5.Ex11.m1.1.1.1.1.3.3.3.cmml">′</mo></msup></mrow></mrow><mo id="S5.Ex11.m1.1.1.1.2" xref="S5.Ex11.m1.1.1.1.1.cmml">,</mo></mrow><annotation-xml encoding="MathML-Content" id="S5.Ex11.m1.1b"><apply id="S5.Ex11.m1.1.1.1.1.cmml" xref="S5.Ex11.m1.1.1.1"><eq id="S5.Ex11.m1.1.1.1.1.1.cmml" xref="S5.Ex11.m1.1.1.1.1.1"></eq><ci id="S5.Ex11.m1.1.1.1.1.2.cmml" xref="S5.Ex11.m1.1.1.1.1.2">𝑟</ci><apply id="S5.Ex11.m1.1.1.1.1.3.cmml" xref="S5.Ex11.m1.1.1.1.1.3"><divide id="S5.Ex11.m1.1.1.1.1.3.1.cmml" xref="S5.Ex11.m1.1.1.1.1.3.1"></divide><ci id="S5.Ex11.m1.1.1.1.1.3.2.cmml" xref="S5.Ex11.m1.1.1.1.1.3.2">𝑛</ci><apply id="S5.Ex11.m1.1.1.1.1.3.3.cmml" xref="S5.Ex11.m1.1.1.1.1.3.3"><csymbol cd="ambiguous" id="S5.Ex11.m1.1.1.1.1.3.3.1.cmml" xref="S5.Ex11.m1.1.1.1.1.3.3">superscript</csymbol><ci id="S5.Ex11.m1.1.1.1.1.3.3.2.cmml" xref="S5.Ex11.m1.1.1.1.1.3.3.2">𝑛</ci><ci id="S5.Ex11.m1.1.1.1.1.3.3.3.cmml" xref="S5.Ex11.m1.1.1.1.1.3.3.3">′</ci></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S5.Ex11.m1.1c">\displaystyle r=n/n^{\prime},</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td>
<td rowspan="1" class="ltx_eqn_cell ltx_eqn_eqno ltx_align_middle ltx_align_right"><span class="ltx_tag ltx_tag_equation ltx_align_right">(9)</span></td>
</tr></tbody>
</table>
<p id="S5.SS1.p1.1" class="ltx_p">Our encoding methodology has significantly optimized token usage within spreadsheets. In our test set, it achieved an impressive 25<math id="S5.SS1.p1.1.m1.1" class="ltx_Math" alttext="\times" display="inline"><semantics id="S5.SS1.p1.1.m1.1a"><mo id="S5.SS1.p1.1.m1.1.1" xref="S5.SS1.p1.1.m1.1.1.cmml">×</mo><annotation-xml encoding="MathML-Content" id="S5.SS1.p1.1.m1.1b"><times id="S5.SS1.p1.1.m1.1.1.cmml" xref="S5.SS1.p1.1.m1.1.1"></times></annotation-xml><annotation encoding="application/x-tex" id="S5.SS1.p1.1.m1.1c">\times</annotation></semantics></math> compression ratio, substantially reducing the computational load for processing large datasets. The specific compression ratios achieved by various module combinations within <span id="S5.SS1.p1.1.1" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> are detailed in Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>. These results highlight the efficacy of our approach across different configurations, demonstrating its robustness and adaptability in handling diverse spreadsheet structures.</p>
</div>
</section>
<section id="S5.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">5.2 </span>Spreadsheet Table Detection</h3>

<figure id="S5.T2" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 2: </span>Results of various Model &amp; Method configurations on spreadsheet table detection. Our encoding method achieved <span id="S5.T2.2.1" class="ltx_text ltx_font_bold">SOTA</span> on the GPT4 model.</figcaption>
<p id="S5.T2.3" class="ltx_p ltx_align_center"><span id="S5.T2.3.1" class="ltx_text ltx_inline-block" style="width:433.6pt;">
<span id="S5.T2.3.1.1" class="ltx_inline-block ltx_transformed_outer" style="width:303.8pt;height:342pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(0.0pt,0.0pt) scale(1,1) ;">
<span id="S5.T2.3.1.1.1" class="ltx_inline-block ltx_transformed_outer" style="width:227.8pt;height:256.5pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-38.0pt,42.8pt) scale(0.75,0.75) ;">
<span id="S5.T2.3.1.1.1.1" class="ltx_p"><span id="S5.T2.3.1.1.1.1.1" class="ltx_text">
<span id="S5.T2.3.1.1.1.1.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<span class="ltx_tbody">
<span id="S5.T2.3.1.1.1.1.1.1.1.1" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_tt">Model &amp; Method</span>
<span id="S5.T2.3.1.1.1.1.1.1.1.1.2" class="ltx_td ltx_align_center ltx_border_tt">Small</span>
<span id="S5.T2.3.1.1.1.1.1.1.1.1.3" class="ltx_td ltx_align_center ltx_border_tt">Medium</span>
<span id="S5.T2.3.1.1.1.1.1.1.1.1.4" class="ltx_td ltx_align_center ltx_border_tt">Large</span>
<span id="S5.T2.3.1.1.1.1.1.1.1.1.5" class="ltx_td ltx_align_center ltx_border_tt">Huge</span>
<span id="S5.T2.3.1.1.1.1.1.1.1.1.6" class="ltx_td ltx_align_center ltx_border_tt">All</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.2.2" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.2.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t ltx_colspan ltx_colspan_6"><span id="S5.T2.3.1.1.1.1.1.1.2.2.1.1" class="ltx_text ltx_font_bold">ICL</span></span></span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.3.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t">Mistral-v2</span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3.2" class="ltx_td ltx_align_center ltx_border_t">0.071</span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3.3" class="ltx_td ltx_align_center ltx_border_t">0.013</span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3.4" class="ltx_td ltx_align_center ltx_border_t">0.029</span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3.5" class="ltx_td ltx_align_center ltx_border_t">0.017</span>
<span id="S5.T2.3.1.1.1.1.1.1.3.3.6" class="ltx_td ltx_align_center ltx_border_t">0.036</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.4.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4</span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4.2" class="ltx_td ltx_align_center">0.318</span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4.3" class="ltx_td ltx_align_center">0.292</span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4.4" class="ltx_td ltx_align_center">0.090</span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4.5" class="ltx_td ltx_align_center">0.000</span>
<span id="S5.T2.3.1.1.1.1.1.1.4.4.6" class="ltx_td ltx_align_center">0.154</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.5.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5.2" class="ltx_td ltx_align_center">0.480</span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5.3" class="ltx_td ltx_align_center">0.454</span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5.4" class="ltx_td ltx_align_center">0.373</span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5.5" class="ltx_td ltx_align_center">0.330</span>
<span id="S5.T2.3.1.1.1.1.1.1.5.5.6" class="ltx_td ltx_align_center">0.410</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.6.6" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.6.6.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t ltx_colspan ltx_colspan_6"><span id="S5.T2.3.1.1.1.1.1.1.6.6.1.1" class="ltx_text ltx_font_bold">Fine-tune</span></span></span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.7.7.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t">Llama3</span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7.2" class="ltx_td ltx_align_center ltx_border_t">0.715</span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7.3" class="ltx_td ltx_align_center ltx_border_t">0.765</span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7.4" class="ltx_td ltx_align_center ltx_border_t">0.290</span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7.5" class="ltx_td ltx_align_center ltx_border_t">0.000</span>
<span id="S5.T2.3.1.1.1.1.1.1.7.7.6" class="ltx_td ltx_align_center ltx_border_t">0.471</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.8.8.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Llama2</span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8.2" class="ltx_td ltx_align_center">0.557</span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8.3" class="ltx_td ltx_align_center">0.378</span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8.4" class="ltx_td ltx_align_center">0.107</span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8.5" class="ltx_td ltx_align_center">0.000</span>
<span id="S5.T2.3.1.1.1.1.1.1.8.8.6" class="ltx_td ltx_align_center">0.280</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.9.9.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Phi3</span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9.2" class="ltx_td ltx_align_center">0.604</span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9.3" class="ltx_td ltx_align_center">0.481</span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9.4" class="ltx_td ltx_align_center">0.201</span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9.5" class="ltx_td ltx_align_center">0.130</span>
<span id="S5.T2.3.1.1.1.1.1.1.9.9.6" class="ltx_td ltx_align_center">0.330</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.10.10.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Mistral-v2</span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10.2" class="ltx_td ltx_align_center">0.700</span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10.3" class="ltx_td ltx_align_center">0.784</span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10.4" class="ltx_td ltx_align_center">0.472</span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10.5" class="ltx_td ltx_align_center">0.123</span>
<span id="S5.T2.3.1.1.1.1.1.1.10.10.6" class="ltx_td ltx_align_center">0.542</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.11.11.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4</span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11.2" class="ltx_td ltx_align_center">0.779</span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11.3" class="ltx_td ltx_align_center">0.707</span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11.4" class="ltx_td ltx_align_center">0.288</span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11.5" class="ltx_td ltx_align_center">0.000</span>
<span id="S5.T2.3.1.1.1.1.1.1.11.11.6" class="ltx_td ltx_align_center">0.520</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.12.12.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t">Llama3-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12.2" class="ltx_td ltx_align_center ltx_border_t">0.825</span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12.3" class="ltx_td ltx_align_center ltx_border_t">0.768</span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12.4" class="ltx_td ltx_align_center ltx_border_t">0.664</span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12.5" class="ltx_td ltx_align_center ltx_border_t">0.617</span>
<span id="S5.T2.3.1.1.1.1.1.1.12.12.6" class="ltx_td ltx_align_center ltx_border_t">0.719</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.13.13.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Llama2-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13.2" class="ltx_td ltx_align_center">0.710</span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13.3" class="ltx_td ltx_align_center">0.722</span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13.4" class="ltx_td ltx_align_center">0.633</span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13.5" class="ltx_td ltx_align_center">0.578</span>
<span id="S5.T2.3.1.1.1.1.1.1.13.13.6" class="ltx_td ltx_align_center">0.660</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.14.14.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Phi3-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14.2" class="ltx_td ltx_align_center">0.800</span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14.3" class="ltx_td ltx_align_center">0.673</span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14.4" class="ltx_td ltx_align_center">0.624</span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14.5" class="ltx_td ltx_align_center">0.675</span>
<span id="S5.T2.3.1.1.1.1.1.1.14.14.6" class="ltx_td ltx_align_center">0.689</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.15.15.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Mistral-v2-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15.2" class="ltx_td ltx_align_center">0.778</span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15.3" class="ltx_td ltx_align_center">0.729</span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15.4" class="ltx_td ltx_align_center">0.686</span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15.5" class="ltx_td ltx_align_center">0.744</span>
<span id="S5.T2.3.1.1.1.1.1.1.15.15.6" class="ltx_td ltx_align_center">0.726</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.16.16.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT3.5-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16.2" class="ltx_td ltx_align_center">0.795</span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16.3" class="ltx_td ltx_align_center">0.649</span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16.4" class="ltx_td ltx_align_center">0.600</span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16.5" class="ltx_td ltx_align_center">0.680</span>
<span id="S5.T2.3.1.1.1.1.1.1.16.16.6" class="ltx_td ltx_align_center">0.680</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.17.17.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4-compress</span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17.2" class="ltx_td ltx_align_center">0.810</span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17.3" class="ltx_td ltx_align_center"><span id="S5.T2.3.1.1.1.1.1.1.17.17.3.1" class="ltx_text ltx_font_bold">0.832</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17.4" class="ltx_td ltx_align_center">0.718</span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17.5" class="ltx_td ltx_align_center">0.690</span>
<span id="S5.T2.3.1.1.1.1.1.1.17.17.6" class="ltx_td ltx_align_center">0.759</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.18.18.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">   -w/o Aggregation</span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18.2" class="ltx_td ltx_align_center"><span id="S5.T2.3.1.1.1.1.1.1.18.18.2.1" class="ltx_text ltx_font_bold">0.864</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18.3" class="ltx_td ltx_align_center">0.816</span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18.4" class="ltx_td ltx_align_center"><span id="S5.T2.3.1.1.1.1.1.1.18.18.4.1" class="ltx_text ltx_font_bold">0.739</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18.5" class="ltx_td ltx_align_center"><span id="S5.T2.3.1.1.1.1.1.1.18.18.5.1" class="ltx_text ltx_font_bold">0.753</span></span>
<span id="S5.T2.3.1.1.1.1.1.1.18.18.6" class="ltx_td ltx_align_center"><span id="S5.T2.3.1.1.1.1.1.1.18.18.6.1" class="ltx_text ltx_font_bold">0.789</span></span></span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19" class="ltx_tr">
<span id="S5.T2.3.1.1.1.1.1.1.19.19.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_t">TableSense-CNN</span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19.2" class="ltx_td ltx_align_center ltx_border_bb ltx_border_t">0.785</span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19.3" class="ltx_td ltx_align_center ltx_border_bb ltx_border_t">0.788</span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19.4" class="ltx_td ltx_align_center ltx_border_bb ltx_border_t">0.567</span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19.5" class="ltx_td ltx_align_center ltx_border_bb ltx_border_t">0.561</span>
<span id="S5.T2.3.1.1.1.1.1.1.19.19.6" class="ltx_td ltx_align_center ltx_border_bb ltx_border_t">0.666</span></span>
</span>
</span></span></span>
</span></span>
</span></span></span></p>
</figure>
<section id="S5.SS2.SSS1" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">5.2.1 </span>Main Results</h4>

<div id="S5.SS2.SSS1.p1" class="ltx_para">
<p id="S5.SS2.SSS1.p1.1" class="ltx_p">Table <a href="#S5.T2" title="Table 2 ‣ 5.2 Spreadsheet Table Detection ‣ 5 Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a> illustrates the performance differences among various models and methods on spreadsheet table detection task, and the detailed case study can refer to Appendix <a href="#A11" title="Appendix K Case Study ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">K</span></a>.</p>
</div>
<div id="S5.SS2.SSS1.p2" class="ltx_para">
<p id="S5.SS2.SSS1.p2.1" class="ltx_p"><span id="S5.SS2.SSS1.p2.1.1" class="ltx_text ltx_font_bold">1) Enhanced Performance with various LLMs:</span> The fine-tuned GPT4 model achieved the F1 score of approximately 76% across all datasets, while our encoding method without aggregation achieved the F1 score of approximately 79% across all datasets. This marked a 27% improvement over the same model fine-tuned on original data, a 13% increase over TableSense-CNN, and established a new <span id="S5.SS2.SSS1.p2.1.2" class="ltx_text ltx_font_bold">SOTA</span>. The entire encoding method slightly reduced the F1 score within a tolerable range, but achieved good compression results, as shown in Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>. We also evaluated our encoding method on a series of open-source models. Notably, Llama3 and Mistral-v2 achieved an F1 score of approximately 72%, just 6 percentage points below the SOTA. The improvements due to our compression method were substantial, with increases of 25% for Llama3, 36% for Phi3, 38% for Llama2, and 18% for Mistral-v2. These results underscored the significant enhancement performance attributable to our encoding method.</p>
</div>
<div id="S5.SS2.SSS1.p3" class="ltx_para">
<p id="S5.SS2.SSS1.p3.1" class="ltx_p"><span id="S5.SS2.SSS1.p3.1.1" class="ltx_text ltx_font_bold">2) Benefits for Larger Spreadsheets:</span> Our compression method significantly boosted performance on larger spreadsheets, where the challenges were most pronounced due to model token limits. The improvements in F1 scores were particularly notable on huge spreadsheets (75% over GPT4, 19% over TableSense-CNN), large spreadsheets (45% and 17%), medium (13% and 5%), and small (8%) spreadsheets. This demonstrated our method’s effectiveness in enabling LLMs to process a broader range of spreadsheet sizes efficiently.</p>
</div>
<div id="S5.SS2.SSS1.p4" class="ltx_para">
<p id="S5.SS2.SSS1.p4.1" class="ltx_p"><span id="S5.SS2.SSS1.p4.1.1" class="ltx_text ltx_font_bold">3) Improvements in In-Context Learning:</span> Compact encoding also significantly enhanced ICL capabilities. For instance, the performance of GPT4 on all data improved by nearly 26%, demonstrating the method’s effectiveness beyond fine-tuned models to include ICL scenarios as well. More ICL results are shown in Appendix <a href="#A10.SS2" title="J.2 The ICL results of open-source models on spreadsheet table detection. ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">J.2</span></a>.</p>
</div>
<div id="S5.SS2.SSS1.p5" class="ltx_para">
<p id="S5.SS2.SSS1.p5.1" class="ltx_p"><span id="S5.SS2.SSS1.p5.1.1" class="ltx_text ltx_font_bold">4) Significant Cost Reduction:</span>
Our cost was almost directly proportional to the input tokens, because the output table regions are short, which can be neglected. Based on the prices of the GPT4 and GPT3.5-turbo models <span id="footnote1" class="ltx_note ltx_role_footnote"><sup class="ltx_note_mark">1</sup><span class="ltx_note_outer"><span class="ltx_note_content"><sup class="ltx_note_mark">1</sup><span class="ltx_tag ltx_tag_note">1</span>https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/</span></span></span> in ICL, we reduced 96% cost in our test set. Detailed calculations are presented in Appendix <a href="#A9" title="Appendix I Cost calculation ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">I</span></a>.</p>
</div>
</section>
<section id="S5.SS2.SSS2" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">
<span class="ltx_tag ltx_tag_subsubsection">5.2.2 </span>Ablation Experiment Results</h4>

<figure id="S5.T3" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 3: </span>Ablation studies on spreadsheet table detection.</figcaption>
<div id="S5.T3.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:228.3pt;height:78.8pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-42.2pt,14.6pt) scale(0.73,0.73) ;">
<table id="S5.T3.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="S5.T3.1.1.1.1" class="ltx_tr">
<th id="S5.T3.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Model</th>
<th id="S5.T3.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="S5.T3.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="S5.T3.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="S5.T3.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="S5.T3.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="S5.T3.1.1.2.1" class="ltx_tr">
<th id="S5.T3.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">GPT4</th>
<td id="S5.T3.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.779</td>
<td id="S5.T3.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.700</td>
<td id="S5.T3.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.288</td>
<td id="S5.T3.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.000</td>
<td id="S5.T3.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.520</td>
</tr>
<tr id="S5.T3.1.1.3.2" class="ltx_tr">
<th id="S5.T3.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">GPT4-compress</th>
<td id="S5.T3.1.1.3.2.2" class="ltx_td ltx_align_center">0.810</td>
<td id="S5.T3.1.1.3.2.3" class="ltx_td ltx_align_center">0.832</td>
<td id="S5.T3.1.1.3.2.4" class="ltx_td ltx_align_center">0.718</td>
<td id="S5.T3.1.1.3.2.5" class="ltx_td ltx_align_center">0.690</td>
<td id="S5.T3.1.1.3.2.6" class="ltx_td ltx_align_center">0.759</td>
</tr>
<tr id="S5.T3.1.1.4.3" class="ltx_tr">
<th id="S5.T3.1.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Extraction</th>
<td id="S5.T3.1.1.4.3.2" class="ltx_td ltx_align_center">0.805</td>
<td id="S5.T3.1.1.4.3.3" class="ltx_td ltx_align_center">0.772</td>
<td id="S5.T3.1.1.4.3.4" class="ltx_td ltx_align_center">0.618</td>
<td id="S5.T3.1.1.4.3.5" class="ltx_td ltx_align_center">0.321</td>
<td id="S5.T3.1.1.4.3.6" class="ltx_td ltx_align_center">0.655</td>
</tr>
<tr id="S5.T3.1.1.5.4" class="ltx_tr">
<th id="S5.T3.1.1.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Translation</th>
<td id="S5.T3.1.1.5.4.2" class="ltx_td ltx_align_center">0.785</td>
<td id="S5.T3.1.1.5.4.3" class="ltx_td ltx_align_center">0.804</td>
<td id="S5.T3.1.1.5.4.4" class="ltx_td ltx_align_center">0.729</td>
<td id="S5.T3.1.1.5.4.5" class="ltx_td ltx_align_center">0.636</td>
<td id="S5.T3.1.1.5.4.6" class="ltx_td ltx_align_center">0.743</td>
</tr>
<tr id="S5.T3.1.1.6.5" class="ltx_tr">
<th id="S5.T3.1.1.6.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">   -w/o Aggregation</th>
<td id="S5.T3.1.1.6.5.2" class="ltx_td ltx_align_center ltx_border_bb">0.864</td>
<td id="S5.T3.1.1.6.5.3" class="ltx_td ltx_align_center ltx_border_bb">0.816</td>
<td id="S5.T3.1.1.6.5.4" class="ltx_td ltx_align_center ltx_border_bb">0.739</td>
<td id="S5.T3.1.1.6.5.5" class="ltx_td ltx_align_center ltx_border_bb">0.753</td>
<td id="S5.T3.1.1.6.5.6" class="ltx_td ltx_align_center ltx_border_bb">0.789</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
<div id="S5.SS2.SSS2.p1" class="ltx_para">
<p id="S5.SS2.SSS2.p1.1" class="ltx_p">Table <a href="#S5.T3" title="Table 3 ‣ 5.2.2 Ablation Experiment Results ‣ 5.2 Spreadsheet Table Detection ‣ 5 Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3</span></a> presents the results of ablation experiments for different modules.
The removal of the extraction module led to significantly lower F1 scores, underscoring its critical role in capturing and retaining key structural information. As highlighted in Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>, this module also achieved the most significant token reduction, confirming its effectiveness. After removing the aggregation module, the F1 score slightly increased. This observation might be attributed to the NFS being more abstract than straightforward numerical representations, which can challenge an LLMs’ ability to interpret them effectively. Despite this, the NFS method offered a significantly high compression rate, enhancing its potential for practical applications and cost control.</p>
</div>
</section>
</section>
<section id="S5.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">5.3 </span>Spreadsheet QA</h3>

<figure id="S5.T4" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 4: </span>The results for Spreadsheet QA show that our method achieved SOTA. "-FT" means fine-tuned model on spreadsheet table detection task and is applied to QA.</figcaption>
<table id="S5.T4.1" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="S5.T4.1.1.1" class="ltx_tr">
<th id="S5.T4.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_tt">Model</th>
<th id="S5.T4.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Accuracy</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="S5.T4.1.2.1" class="ltx_tr">
<th id="S5.T4.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t"><span id="S5.T4.1.2.1.1.1" class="ltx_text ltx_font_smallcaps">TaPEx</span></th>
<td id="S5.T4.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.378</td>
</tr>
<tr id="S5.T4.1.3.2" class="ltx_tr">
<th id="S5.T4.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">Binder</th>
<td id="S5.T4.1.3.2.2" class="ltx_td ltx_align_center">0.622</td>
</tr>
<tr id="S5.T4.1.4.3" class="ltx_tr">
<th id="S5.T4.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4</th>
<td id="S5.T4.1.4.3.2" class="ltx_td ltx_align_center">0.466</td>
</tr>
<tr id="S5.T4.1.5.4" class="ltx_tr">
<th id="S5.T4.1.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4-compress-w/o splitting</th>
<td id="S5.T4.1.5.4.2" class="ltx_td ltx_align_center">0.651</td>
</tr>
<tr id="S5.T4.1.6.5" class="ltx_tr">
<th id="S5.T4.1.6.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4-compress-w/o splitting-FT</th>
<td id="S5.T4.1.6.5.2" class="ltx_td ltx_align_center">0.694</td>
</tr>
<tr id="S5.T4.1.7.6" class="ltx_tr">
<th id="S5.T4.1.7.6.1" class="ltx_td ltx_align_left ltx_th ltx_th_row">GPT4-compress</th>
<td id="S5.T4.1.7.6.2" class="ltx_td ltx_align_center">0.684</td>
</tr>
<tr id="S5.T4.1.8.7" class="ltx_tr">
<th id="S5.T4.1.8.7.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb">GPT4-compress-FT</th>
<td id="S5.T4.1.8.7.2" class="ltx_td ltx_align_center ltx_border_bb"><span id="S5.T4.1.8.7.2.1" class="ltx_text ltx_font_bold">0.743</span></td>
</tr>
</tbody>
</table>
</figure>
<div id="S5.SS3.p1" class="ltx_para">
<p id="S5.SS3.p1.1" class="ltx_p">Table <a href="#S5.T4" title="Table 4 ‣ 5.3 Spreadsheet QA ‣ 5 Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4</span></a> shows the performance of various models on Spreadsheet QA tasks. We can draw the following conclusions:</p>
</div>
<div id="S5.SS3.p2" class="ltx_para">
<p id="S5.SS3.p2.1" class="ltx_p"><span id="S5.SS3.p2.1.1" class="ltx_text ltx_font_bold">1) Effectiveness of the CoS Method:</span> The CoS method we developed significantly boosted the accuracy of models, showing a notable increase of 22% over the baseline GPT4 model. Given the large size of typical spreadsheets, directly inputting entire files often exceeded the token limits of conventional models. The CoS effectively addressed this issue by focusing only on regions relevant to the questions posed, thereby reducing redundant data and enabling more efficient handling of QA tasks on larger spreadsheets.</p>
</div>
<div id="S5.SS3.p3" class="ltx_para">
<p id="S5.SS3.p3.1" class="ltx_p"><span id="S5.SS3.p3.1.1" class="ltx_text ltx_font_bold">2) Generalization Capability of the Fine-tuned Model:</span> The model that has been fine-tuned on the spreadsheet table detection task demonstrated robust generalization capabilities across downstream QA tasks. This fine-tuning led to an accuracy improvement of 6%. Moreover, it significantly outperformed the <span id="S5.SS3.p3.1.2" class="ltx_text ltx_font_smallcaps">TaPEx</span> and Binder models by 37% and 12%, respectively. This substantial margin highlighted that fine-tuning not only prepared the model to better understand the specific data and structural nuances of spreadsheets but also enhanced its overall comprehension abilities.</p>
</div>
<div id="S5.SS3.p4" class="ltx_para">
<p id="S5.SS3.p4.1" class="ltx_p">Table <a href="#S5.T4" title="Table 4 ‣ 5.3 Spreadsheet QA ‣ 5 Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4</span></a> also shows the influence of our designed split method on QA task performance. It can be seen that using the split algorithm improved accuracy by 3% and 5% on ICL and fine-tuning respectively. Therefore, LLMs can process some tables unable to be processed originally due to the token limitations, which enhances the performance of <span id="S5.SS3.p4.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>.</p>
</div>
</section>
</section>
<section id="S6" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">6 </span>Conclusion</h2>

<div id="S6.p1" class="ltx_para">
<p id="S6.p1.1" class="ltx_p">In this paper, we proposed the <span id="S6.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>, a novel framework representing a significant advancement in the processing and understanding of spreadsheet data by leveraging the capabilities of LLMs. Through a novel encoding method, <span id="S6.p1.1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span>, this framework effectively addresses the challenges posed by the size, diversity, and complexity inherent in spreadsheets. It achieves a substantial reduction in token usage and computational costs, enabling practical applications on large datasets. The fine-tuning of various cutting-edge LLMs further enhances the performance of spreadsheet understanding. Moreover, Chain of Spreadsheet, the framework’s extension to spreadsheet downstream tasks illustrates its broad applicability and potential to transform spreadsheet data management and analysis, paving the way for more intelligent and efficient user interactions.</p>
</div>
<div class="ltx_pagination ltx_role_newpage"></div>
</section>
<section id="Sx1" class="ltx_section">
<h2 class="ltx_title ltx_title_section">Limitations</h2>

<div id="Sx1.p1" class="ltx_para">
<p id="Sx1.p1.1" class="ltx_p">While our <span id="Sx1.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> frameworks have markedly advanced how LLMs interpret and utilize spreadsheets, they also illuminate areas ripe for further research and development. Currently, our methods do not yet harness spreadsheet format details such as background color and borders, because they take too many tokens. However, these elements often contain valuable contextual and visual cues that could further refine our understanding and processing of spreadsheet data. Additionally, while <span id="Sx1.p1.1.2" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> effectively aggregates data regions, it does not currently employ a sophisticated semantic-based compression method for cells containing natural language. For example, categorizing terms like "China," "America," and "France" under a unified label such as "Country" could not only increase the compression ratio but also deepen the semantic understanding of the data by LLMs. Exploring these advanced semantic compression techniques will be a key focus of our ongoing efforts to enhance the capabilities of <span id="Sx1.p1.1.3" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span>.</p>
</div>
</section>
<section id="Sx2" class="ltx_section">
<h2 class="ltx_title ltx_title_section">Ethics Statement</h2>

<div id="Sx2.p1" class="ltx_para">
<p id="Sx2.p1.1" class="ltx_p">All data were collected, analyzed, and reported without any bias or influence from external sources. The privacy and confidentiality of the participants were strictly maintained throughout the research process. No personal identifiers were used in the analysis or reporting of the data to ensure anonymity. At the same time, data standard personnel were paid according to the highest local standard, and their daily working hours were strictly limited to no more than 8 hours to protect their legitimate rights and interests.
We acknowledge the contributions of all individuals and institutions involved in this study and are committed to sharing our findings and methodologies transparently to facilitate further research and knowledge advancement in the field.</p>
</div>
</section>
<section id="bib" class="ltx_bibliography">
<h2 class="ltx_title ltx_title_bibliography">References</h2>

<ul class="ltx_biblist">
<li id="bib.bib1" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Chen et al. (2024)</span>
<span class="ltx_bibblock">
Sibei Chen, Yeye He, Weiwei Cui, Ju Fan, Song Ge, Haidong Zhang, Dongmei Zhang, and Surajit Chaudhuri. 2024.

</span>
<span class="ltx_bibblock">Auto-formula: Recommend formulas in spreadsheets using contrastive learning for table representations.

</span>
<span class="ltx_bibblock"><em id="bib.bib1.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2404.12608</em>.

</span>
</li>
<li id="bib.bib2" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Chen et al. (2021)</span>
<span class="ltx_bibblock">
Xinyun Chen, Petros Maniatis, Rishabh Singh, Charles Sutton, Hanjun Dai, Max Lin, and Denny Zhou. 2021.

</span>
<span class="ltx_bibblock">Spreadsheetcoder: Formula prediction from semi-structured context.

</span>
<span class="ltx_bibblock">In <em id="bib.bib2.1.1" class="ltx_emph ltx_font_italic">International Conference on Machine Learning</em>, pages 1661–1672. PMLR.

</span>
</li>
<li id="bib.bib3" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Chen and Cafarella (2013)</span>
<span class="ltx_bibblock">
Zhe Chen and Michael Cafarella. 2013.

</span>
<span class="ltx_bibblock">Automatic web spreadsheet data extraction.

</span>
<span class="ltx_bibblock">In <em id="bib.bib3.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 3rd International Workshop on Semantic Search over the Web</em>, pages 1–8.

</span>
</li>
<li id="bib.bib4" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Chen and Cafarella (2014)</span>
<span class="ltx_bibblock">
Zhe Chen and Michael Cafarella. 2014.

</span>
<span class="ltx_bibblock">Integrating spreadsheet data via accurate and low-effort extraction.

</span>
<span class="ltx_bibblock">In <em id="bib.bib4.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining</em>, pages 1126–1135.

</span>
</li>
<li id="bib.bib5" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Cheng et al. (2021a)</span>
<span class="ltx_bibblock">
Zhoujun Cheng, Haoyu Dong, Ran Jia, Pengfei Wu, Shi Han, Fan Cheng, and Dongmei Zhang. 2021a.

</span>
<span class="ltx_bibblock">Fortap: Using formulas for numerical-reasoning-aware table pretraining.

</span>
<span class="ltx_bibblock"><em id="bib.bib5.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2109.07323</em>.

</span>
</li>
<li id="bib.bib6" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Cheng et al. (2021b)</span>
<span class="ltx_bibblock">
Zhoujun Cheng, Haoyu Dong, Zhiruo Wang, Ran Jia, Jiaqi Guo, Yan Gao, Shi Han, Jian-Guang Lou, and Dongmei Zhang. 2021b.

</span>
<span class="ltx_bibblock">Hitab: A hierarchical table dataset for question answering and natural language generation.

</span>
<span class="ltx_bibblock"><em id="bib.bib6.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2108.06712</em>.

</span>
</li>
<li id="bib.bib7" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Cheng et al. (2022)</span>
<span class="ltx_bibblock">
Zhoujun Cheng, Tianbao Xie, Peng Shi, Chengzu Li, Rahul Nadkarni, Yushi Hu, Caiming Xiong, Dragomir Radev, Mari Ostendorf, Luke Zettlemoyer, et al. 2022.

</span>
<span class="ltx_bibblock">Binding language models in symbolic languages.

</span>
<span class="ltx_bibblock"><em id="bib.bib7.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2210.02875</em>.

</span>
</li>
<li id="bib.bib8" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Christodoulakis et al. (2020)</span>
<span class="ltx_bibblock">
Christina Christodoulakis, Eric B Munson, Moshe Gabel, Angela Demke Brown, and Renée J Miller. 2020.

</span>
<span class="ltx_bibblock">Pytheas: pattern-based table discovery in csv files.

</span>
<span class="ltx_bibblock"><em id="bib.bib8.1.1" class="ltx_emph ltx_font_italic">Proceedings of the VLDB Endowment</em>, 13(12):2075–2089.

</span>
</li>
<li id="bib.bib9" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Deng et al. (2024)</span>
<span class="ltx_bibblock">
Naihao Deng, Zhenjie Sun, Ruiqi He, Aman Sikka, Yulong Chen, Lin Ma, Yue Zhang, and Rada Mihalcea. 2024.

</span>
<span class="ltx_bibblock">Tables as images? exploring the strengths and limitations of llms on multimodal representations of tabular data.

</span>
<span class="ltx_bibblock"><em id="bib.bib9.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2402.12424</em>.

</span>
</li>
<li id="bib.bib10" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Deng et al. (2022)</span>
<span class="ltx_bibblock">
Xiang Deng, Huan Sun, Alyssa Lees, You Wu, and Cong Yu. 2022.

</span>
<span class="ltx_bibblock">Turl: Table understanding through representation learning.

</span>
<span class="ltx_bibblock"><em id="bib.bib10.1.1" class="ltx_emph ltx_font_italic">ACM SIGMOD Record</em>, 51(1):33–40.

</span>
</li>
<li id="bib.bib11" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Dong et al. (2022)</span>
<span class="ltx_bibblock">
Haoyu Dong, Zhoujun Cheng, Xinyi He, Mengyu Zhou, Anda Zhou, Fan Zhou, Ao Liu, Shi Han, and Dongmei Zhang. 2022.

</span>
<span class="ltx_bibblock">Table Pretraining: A survey on model architectures, pretraining objectives, and downstream tasks.

</span>
<span class="ltx_bibblock"><em id="bib.bib11.1.1" class="ltx_emph ltx_font_italic">Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence</em>.

</span>
</li>
<li id="bib.bib12" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Dong et al. (2019a)</span>
<span class="ltx_bibblock">
Haoyu Dong, Shijie Liu, Zhouyu Fu, Shi Han, and Dongmei Zhang. 2019a.

</span>
<span class="ltx_bibblock">Semantic structure extraction for spreadsheet tables with a multi-task learning architecture.

</span>
<span class="ltx_bibblock">In <em id="bib.bib12.1.1" class="ltx_emph ltx_font_italic">Workshop on Document Intelligence at NeurIPS 2019</em>.

</span>
</li>
<li id="bib.bib13" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Dong et al. (2019b)</span>
<span class="ltx_bibblock">
Haoyu Dong, Shijie Liu, Shi Han, Zhouyu Fu, and Dongmei Zhang. 2019b.

</span>
<span class="ltx_bibblock">TableSense: Spreadsheet table detection with convolutional neural networks.

</span>
<span class="ltx_bibblock">In <em id="bib.bib13.1.1" class="ltx_emph ltx_font_italic">Proceedings of the AAAI Conference on Artificial Intelligence</em>, volume 33, pages 69–76.

</span>
</li>
<li id="bib.bib14" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Dou et al. (2018)</span>
<span class="ltx_bibblock">
Wensheng Dou, Shi Han, Liang Xu, Dongmei Zhang, and Jun Wei. 2018.

</span>
<span class="ltx_bibblock">Expandable group identification in spreadsheets.

</span>
<span class="ltx_bibblock">In <em id="bib.bib14.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering</em>, pages 498–508.

</span>
</li>
<li id="bib.bib15" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Dou et al. (2016)</span>
<span class="ltx_bibblock">
Wensheng Dou, Chang Xu, Shing-Chi Cheung, and Jun Wei. 2016.

</span>
<span class="ltx_bibblock">Cacheck: detecting and repairing cell arrays in spreadsheets.

</span>
<span class="ltx_bibblock"><em id="bib.bib15.1.1" class="ltx_emph ltx_font_italic">IEEE Transactions on Software Engineering</em>, 43(3):226–251.

</span>
</li>
<li id="bib.bib16" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Doush and Pontelli (2010)</span>
<span class="ltx_bibblock">
Iyad Abu Doush and Enrico Pontelli. 2010.

</span>
<span class="ltx_bibblock">Detecting and recognizing tables in spreadsheets.

</span>
<span class="ltx_bibblock">In <em id="bib.bib16.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 9th IAPR International Workshop on Document Analysis Systems</em>, pages 471–478.

</span>
</li>
<li id="bib.bib17" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Gol et al. (2019)</span>
<span class="ltx_bibblock">
Majid Ghasemi Gol, Jay Pujara, and Pedro Szekely. 2019.

</span>
<span class="ltx_bibblock">Tabular cell classification using pre-trained cell embeddings.

</span>
<span class="ltx_bibblock">In <em id="bib.bib17.1.1" class="ltx_emph ltx_font_italic">2019 IEEE International Conference on Data Mining (ICDM)</em>, pages 230–239. IEEE.

</span>
</li>
<li id="bib.bib18" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">He et al. (2024)</span>
<span class="ltx_bibblock">
Xinyi He, Mengyu Zhou, Xinrun Xu, Xiaojun Ma, Rui Ding, Lun Du, Yan Gao, Ran Jia, Xu Chen, Shi Han, et al. 2024.

</span>
<span class="ltx_bibblock">Text2analysis: A benchmark of table question answering with advanced data analysis and unclear queries.

</span>
<span class="ltx_bibblock">In <em id="bib.bib18.1.1" class="ltx_emph ltx_font_italic">Proceedings of the AAAI Conference on Artificial Intelligence</em>, volume 38, pages 18206–18215.

</span>
</li>
<li id="bib.bib19" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Herzig et al. (2020)</span>
<span class="ltx_bibblock">
Jonathan Herzig, Paweł Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Martin Eisenschlos. 2020.

</span>
<span class="ltx_bibblock">TaPas: Weakly supervised table parsing via pre-training.

</span>
<span class="ltx_bibblock"><em id="bib.bib19.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2004.02349</em>.

</span>
</li>
<li id="bib.bib20" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Hulsebos et al. (2019)</span>
<span class="ltx_bibblock">
Madelon Hulsebos, Kevin Hu, Michiel Bakker, Emanuel Zgraggen, Arvind Satyanarayan, Tim Kraska, Çagatay Demiralp, and César Hidalgo. 2019.

</span>
<span class="ltx_bibblock">Sherlock: A deep learning approach to semantic data type detection.

</span>
<span class="ltx_bibblock">In <em id="bib.bib20.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery &amp; Data Mining</em>, pages 1500–1508.

</span>
</li>
<li id="bib.bib21" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Jiang et al. (2023a)</span>
<span class="ltx_bibblock">
Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. 2023a.

</span>
<span class="ltx_bibblock">Llmlingua: Compressing prompts for accelerated inference of large language models.

</span>
<span class="ltx_bibblock"><em id="bib.bib21.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2310.05736</em>.

</span>
</li>
<li id="bib.bib22" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Jiang et al. (2023b)</span>
<span class="ltx_bibblock">
Jinhao Jiang, Kun Zhou, Zican Dong, Keming Ye, Wayne Xin Zhao, and Ji-Rong Wen. 2023b.

</span>
<span class="ltx_bibblock">Structgpt: A general framework for large language model to reason over structured data.

</span>
<span class="ltx_bibblock"><em id="bib.bib22.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2305.09645</em>.

</span>
</li>
<li id="bib.bib23" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Jiang et al. (2022)</span>
<span class="ltx_bibblock">
Zhengbao Jiang, Yi Mao, Pengcheng He, Graham Neubig, and Weizhu Chen. 2022.

</span>
<span class="ltx_bibblock">Omnitab: Pretraining with natural and synthetic data for few-shot table-based question answering.

</span>
<span class="ltx_bibblock"><em id="bib.bib23.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2207.03637</em>.

</span>
</li>
<li id="bib.bib24" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Joshi et al. (2024)</span>
<span class="ltx_bibblock">
Harshit Joshi, Abishai Ebenezer, José Cambronero Sanchez, Sumit Gulwani, Aditya Kanade, Vu Le, Ivan Radiček, and Gust Verbruggen. 2024.

</span>
<span class="ltx_bibblock">Flame: A small language model for spreadsheet formulas.

</span>
<span class="ltx_bibblock">In <em id="bib.bib24.1.1" class="ltx_emph ltx_font_italic">Proceedings of the AAAI Conference on Artificial Intelligence</em>, volume 38, pages 12995–13003.

</span>
</li>
<li id="bib.bib25" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Li et al. (2023a)</span>
<span class="ltx_bibblock">
Hongxin Li, Jingran Su, et al. 2023a.

</span>
<span class="ltx_bibblock">SheetCopilot: Bringing Software Productivity to the Next Level through Large Language Models.

</span>
<span class="ltx_bibblock">In <em id="bib.bib25.1.1" class="ltx_emph ltx_font_italic">NeurIPS</em>.

</span>
</li>
<li id="bib.bib26" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Li et al. (2024)</span>
<span class="ltx_bibblock">
Peng Li, Yeye He, Cong Yan, Yue Wang, and Surajit Chaudhuri. 2024.

</span>
<span class="ltx_bibblock">Auto-tables: Relationalize tables without using examples.

</span>
<span class="ltx_bibblock"><em id="bib.bib26.1.1" class="ltx_emph ltx_font_italic">ACM SIGMOD Record</em>, 53(1):76–85.

</span>
</li>
<li id="bib.bib27" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Li et al. (2023b)</span>
<span class="ltx_bibblock">
Peng Li, Yeye He, Dror Yashar, Weiwei Cui, Song Ge, Haidong Zhang, Danielle Rifinski Fainman, Dongmei Zhang, and Surajit Chaudhuri. 2023b.

</span>
<span class="ltx_bibblock">Table-gpt: Table-tuned gpt for diverse table tasks.

</span>
<span class="ltx_bibblock"><em id="bib.bib27.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2310.09263</em>.

</span>
</li>
<li id="bib.bib28" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Li (2023)</span>
<span class="ltx_bibblock">
Yucheng Li. 2023.

</span>
<span class="ltx_bibblock">Unlocking context constraints of llms: Enhancing context efficiency of llms with self-information-based content filtering.

</span>
<span class="ltx_bibblock"><em id="bib.bib28.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2304.12102</em>.

</span>
</li>
<li id="bib.bib29" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Liu et al. (2024)</span>
<span class="ltx_bibblock">
Nelson F Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024.

</span>
<span class="ltx_bibblock">Lost in the middle: How language models use long contexts.

</span>
<span class="ltx_bibblock"><em id="bib.bib29.1.1" class="ltx_emph ltx_font_italic">Transactions of the Association for Computational Linguistics</em>, 12:157–173.

</span>
</li>
<li id="bib.bib30" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Nishida et al. (2017)</span>
<span class="ltx_bibblock">
Kyosuke Nishida, Kugatsu Sadamitsu, Ryuichiro Higashinaka, and Yoshihiro Matsuo. 2017.

</span>
<span class="ltx_bibblock">Understanding the semantic structures of tables with a hybrid deep neural network architecture.

</span>
<span class="ltx_bibblock">In <em id="bib.bib30.1.1" class="ltx_emph ltx_font_italic">Thirty-First AAAI Conference on Artificial Intelligence</em>.

</span>
</li>
<li id="bib.bib31" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Pan et al. (2024)</span>
<span class="ltx_bibblock">
Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, et al. 2024.

</span>
<span class="ltx_bibblock">Llmlingua-2: Data distillation for efficient and faithful task-agnostic prompt compression.

</span>
<span class="ltx_bibblock"><em id="bib.bib31.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2403.12968</em>.

</span>
</li>
<li id="bib.bib32" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Sui et al. (2023)</span>
<span class="ltx_bibblock">
Yuan Sui, Mengyu Zhou, Mingjie Zhou, Shi Han, and Dongmei Zhang. 2023.

</span>
<span class="ltx_bibblock">Gpt4table: Can large language models understand structured table data? a benchmark and empirical study.

</span>
<span class="ltx_bibblock"><em id="bib.bib32.1.1" class="ltx_emph ltx_font_italic">arXiv preprint ArXiv:2305.13062</em>.

</span>
</li>
<li id="bib.bib33" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Sui et al. (2024)</span>
<span class="ltx_bibblock">
Yuan Sui, Mengyu Zhou, Mingjie Zhou, Shi Han, and Dongmei Zhang. 2024.

</span>
<span class="ltx_bibblock">Table meets llm: Can large language models understand structured table data? a benchmark and empirical study.

</span>
<span class="ltx_bibblock">In <em id="bib.bib33.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 17th ACM International Conference on Web Search and Data Mining</em>, pages 645–654.

</span>
</li>
<li id="bib.bib34" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Vitagliano et al. (2022)</span>
<span class="ltx_bibblock">
Gerardo Vitagliano, Lucas Reisener, Lan Jiang, Mazhar Hameed, and Felix Naumann. 2022.

</span>
<span class="ltx_bibblock">Mondrian: Spreadsheet layout detection.

</span>
<span class="ltx_bibblock">In <em id="bib.bib34.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 2022 International Conference on Management of Data</em>, pages 2361–2364.

</span>
</li>
<li id="bib.bib35" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Wang and He (2019)</span>
<span class="ltx_bibblock">
Pei Wang and Yeye He. 2019.

</span>
<span class="ltx_bibblock">Uni-detect: A unified approach to automated error detection in tables.

</span>
<span class="ltx_bibblock">In <em id="bib.bib35.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 2019 International Conference on Management of Data</em>, pages 811–828.

</span>
</li>
<li id="bib.bib36" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Wang et al. (2023)</span>
<span class="ltx_bibblock">
Tianshu Wang, Hongyu Lin, Xianpei Han, Le Sun, Xiaoyang Chen, Hao Wang, and Zhenyu Zeng. 2023.

</span>
<span class="ltx_bibblock">Dbcopilot: Scaling natural language querying to massive databases.

</span>
<span class="ltx_bibblock"><em id="bib.bib36.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2312.03463</em>.

</span>
</li>
<li id="bib.bib37" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Wang et al. (2021)</span>
<span class="ltx_bibblock">
Zhiruo Wang, Haoyu Dong, Ran Jia, Jia Li, Zhiyi Fu, Shi Han, and Dongmei Zhang. 2021.

</span>
<span class="ltx_bibblock">TUTA: Tree-based transformers for generally structured table pre-training.

</span>
<span class="ltx_bibblock">In <em id="bib.bib37.1.1" class="ltx_emph ltx_font_italic">Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery &amp; Data Mining</em>, pages 1780–1790.

</span>
</li>
<li id="bib.bib38" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Xia et al. (2024)</span>
<span class="ltx_bibblock">
Shiyu Xia, Junyu Xiong, Haoyu Dong, Jianbo Zhao, Yuzhang Tian, Mengyu Zhou, Yeye He, Shi Han, and Dongmei Zhang. 2024.

</span>
<span class="ltx_bibblock">Vision language models for spreadsheet understanding: Challenges and opportunities.

</span>
<span class="ltx_bibblock"><em id="bib.bib38.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2405.16234</em>.

</span>
</li>
<li id="bib.bib39" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Xu et al. (2023)</span>
<span class="ltx_bibblock">
Peng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee, Chen Zhu, Zihan Liu, Sandeep Subramanian, Evelina Bakhturina, Mohammad Shoeybi, and Bryan Catanzaro. 2023.

</span>
<span class="ltx_bibblock">Retrieval meets long context large language models.

</span>
<span class="ltx_bibblock"><em id="bib.bib39.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2310.03025</em>.

</span>
</li>
<li id="bib.bib40" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Zhang et al. (2023)</span>
<span class="ltx_bibblock">
Tianshu Zhang, Xiang Yue, Yifei Li, and Huan Sun. 2023.

</span>
<span class="ltx_bibblock">Tablellama: Towards open large generalist models for tables.

</span>
<span class="ltx_bibblock"><em id="bib.bib40.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2311.09206</em>.

</span>
</li>
<li id="bib.bib41" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Zhang et al. (2024)</span>
<span class="ltx_bibblock">
Xiaokang Zhang, Jing Zhang, Zeyao Ma, Yang Li, Bohan Zhang, Guanlin Li, Zijun Yao, Kangli Xu, Jinchang Zhou, Daniel Zhang-Li, et al. 2024.

</span>
<span class="ltx_bibblock">Tablellm: Enabling tabular data manipulation by llms in real office usage scenarios.

</span>
<span class="ltx_bibblock"><em id="bib.bib41.1.1" class="ltx_emph ltx_font_italic">arXiv preprint arXiv:2403.19318</em>.

</span>
</li>
<li id="bib.bib42" class="ltx_bibitem">
<span class="ltx_tag ltx_role_refnum ltx_tag_bibitem">Zheng et al. (2023)</span>
<span class="ltx_bibblock">
Mingyu Zheng, Hao Yang, Wenbin Jiang, Zheng Lin, Yajuan Lyu, Qiaoqiao She, and Weiping Wang. 2023.

</span>
<span class="ltx_bibblock"><a target="_blank" href="https://doi.org/10.18653/v1/2023.findings-emnlp.734" title="" class="ltx_ref ltx_href">Chain-of-thought reasoning in tabular language models</a>.

</span>
<span class="ltx_bibblock">pages 11006–11019.

</span>
</li>
</ul>
</section>
<div class="ltx_pagination ltx_role_newpage"></div>
<section id="A1" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix A </span>GPT4 Struggles to Understand Spreadsheets</h2>

<div id="A1.p1" class="ltx_para">
<p id="A1.p1.1" class="ltx_p">The Figure <a href="#A1.F3" title="Figure 3 ‣ Appendix A GPT4 Struggles to Understand Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3</span></a> and Figure <a href="#A1.F4" title="Figure 4 ‣ Appendix A GPT4 Struggles to Understand Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4</span></a> show how GPT4 struggles to understand spreadsheets. We also validated the effect of cell format on the vanilla encoding method on the spreadsheet table detection task. As shown in Table <a href="#A1.T5" title="Table 5 ‣ Appendix A GPT4 Struggles to Understand Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">5</span></a>, the results indicate that in ICL, the inclusion of format marginally improves the model’s performance on small datasets but results in poorer performance on larger datasets. For the fine-tuned model, the inclusion of format information leads to a significant reduction in the overall F1 score. This decline is attributed to the introduction of additional tokens, which causes some data to exceed the model’s token limits. Additionally, LLMs are not yet adept at understanding format information.</p>
</div>
<figure id="A1.F3" class="ltx_figure"><img src="/html/2407.09025/assets/fig/GPT-4-1.png" id="A1.F3.g1" class="ltx_graphics ltx_centering ltx_img_square" width="299" height="352" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 3: </span>Challenges of GPT4 understanding spreadsheet data.</figcaption>
</figure>
<figure id="A1.F4" class="ltx_figure"><img src="/html/2407.09025/assets/fig/GPT-4-2.png" id="A1.F4.g1" class="ltx_graphics ltx_centering ltx_img_square" width="299" height="351" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 4: </span>GPT4 encoding methods and techniques for processing spreadsheet data.</figcaption>
</figure>
<figure id="A1.T5" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 5: </span>The results of spreadsheet table detection experiment with cell format.</figcaption>
<div id="A1.T5.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:230.5pt;height:69.3pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-34.4pt,10.4pt) scale(0.77,0.77) ;">
<table id="A1.T5.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A1.T5.1.1.1.1" class="ltx_tr">
<th id="A1.T5.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Model</th>
<th id="A1.T5.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="A1.T5.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="A1.T5.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="A1.T5.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="A1.T5.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A1.T5.1.1.2.1" class="ltx_tr">
<th id="A1.T5.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">GPT4-ICL</th>
<td id="A1.T5.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.318</td>
<td id="A1.T5.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.292</td>
<td id="A1.T5.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.090</td>
<td id="A1.T5.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.000</td>
<td id="A1.T5.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.154</td>
</tr>
<tr id="A1.T5.1.1.3.2" class="ltx_tr">
<th id="A1.T5.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">GPT4-ICL-FMT</th>
<td id="A1.T5.1.1.3.2.2" class="ltx_td ltx_align_center">0.429</td>
<td id="A1.T5.1.1.3.2.3" class="ltx_td ltx_align_center">0.000</td>
<td id="A1.T5.1.1.3.2.4" class="ltx_td ltx_align_center">0.000</td>
<td id="A1.T5.1.1.3.2.5" class="ltx_td ltx_align_center">0.000</td>
<td id="A1.T5.1.1.3.2.6" class="ltx_td ltx_align_center">0.204</td>
</tr>
<tr id="A1.T5.1.1.4.3" class="ltx_tr">
<th id="A1.T5.1.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">GPT4-FT</th>
<td id="A1.T5.1.1.4.3.2" class="ltx_td ltx_align_center">0.779</td>
<td id="A1.T5.1.1.4.3.3" class="ltx_td ltx_align_center">0.707</td>
<td id="A1.T5.1.1.4.3.4" class="ltx_td ltx_align_center">0.288</td>
<td id="A1.T5.1.1.4.3.5" class="ltx_td ltx_align_center">0.000</td>
<td id="A1.T5.1.1.4.3.6" class="ltx_td ltx_align_center">0.520</td>
</tr>
<tr id="A1.T5.1.1.5.4" class="ltx_tr">
<th id="A1.T5.1.1.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">GPT4-FT-FMT</th>
<td id="A1.T5.1.1.5.4.2" class="ltx_td ltx_align_center ltx_border_bb">0.758</td>
<td id="A1.T5.1.1.5.4.3" class="ltx_td ltx_align_center ltx_border_bb">0.000</td>
<td id="A1.T5.1.1.5.4.4" class="ltx_td ltx_align_center ltx_border_bb">0.000</td>
<td id="A1.T5.1.1.5.4.5" class="ltx_td ltx_align_center ltx_border_bb">0.000</td>
<td id="A1.T5.1.1.5.4.6" class="ltx_td ltx_align_center ltx_border_bb">0.315</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="A2" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix B </span>Traditional Encoding Methods for Spreadsheets</h2>

<div id="A2.p1" class="ltx_para">
<p id="A2.p1.1" class="ltx_p">In our study, we explored traditional encoding methods—Markdown, XML, and HTML—to represent spreadsheet data. Figure <a href="#A2.F5" title="Figure 5 ‣ Appendix B Traditional Encoding Methods for Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">5</span></a> illustrates the comparative analysis of these methods. XML and HTML encoding, while widely used, tend to result in high token consumption due to the extensive use of repeated label tags necessary for representing the data structure. This approach markedly increases the volume of data processed.</p>
</div>
<div id="A2.p2" class="ltx_para">
<p id="A2.p2.1" class="ltx_p">Conversely, the Markdown method, although more token-efficient, has its limitations. One significant drawback is the lack of explicit cell address information, which frequently leads to errors when indexing specific cell locations. Additionally, Markdown’s rigid structure rules complicate the accurate representation of merged cells, a common feature in complex spreadsheets that is crucial for preserving the integrity of data relationships.</p>
</div>
<div id="A2.p3" class="ltx_para">
<p id="A2.p3.1" class="ltx_p">To quantitatively assess these methods, we conducted ICL experiments using the GPT-4 model on spreadsheet detection tasks. The results, detailed in Table <a href="#A2.T6" title="Table 6 ‣ Appendix B Traditional Encoding Methods for Spreadsheets ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">6</span></a>, confirmed that while the Markdown method outperformed XML and HTML in terms of lower token usage, it still fell short in addressing the needs of spreadsheet encoding effectively.</p>
</div>
<figure id="A2.F5" class="ltx_figure"><img src="/html/2407.09025/assets/fig/traditional_enc.png" id="A2.F5.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="377" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 5: </span>Examples of three traditional spreadsheet encoding methods: Markdown, XML, and HTML. Due to space limitations, we only show the encoding of some cells.</figcaption>
</figure>
<figure id="A2.T6" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 6: </span>The ICL experiments of different encoding methods of the spreadsheet on GPT4.</figcaption>
<div id="A2.T6.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:217.8pt;height:57.6pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-27.2pt,7.2pt) scale(0.8,0.8) ;">
<table id="A2.T6.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A2.T6.1.1.1.1" class="ltx_tr">
<th id="A2.T6.1.1.1.1.1" class="ltx_td ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt"></th>
<th id="A2.T6.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="A2.T6.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="A2.T6.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="A2.T6.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="A2.T6.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A2.T6.1.1.2.1" class="ltx_tr">
<th id="A2.T6.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">HTML</th>
<td id="A2.T6.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.074</td>
<td id="A2.T6.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.016</td>
<td id="A2.T6.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.003</td>
<td id="A2.T6.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.000</td>
<td id="A2.T6.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.031</td>
</tr>
<tr id="A2.T6.1.1.3.2" class="ltx_tr">
<th id="A2.T6.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">XML</th>
<td id="A2.T6.1.1.3.2.2" class="ltx_td ltx_align_center">0.292</td>
<td id="A2.T6.1.1.3.2.3" class="ltx_td ltx_align_center">0.102</td>
<td id="A2.T6.1.1.3.2.4" class="ltx_td ltx_align_center">0.066</td>
<td id="A2.T6.1.1.3.2.5" class="ltx_td ltx_align_center">0.000</td>
<td id="A2.T6.1.1.3.2.6" class="ltx_td ltx_align_center">0.142</td>
</tr>
<tr id="A2.T6.1.1.4.3" class="ltx_tr">
<th id="A2.T6.1.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">Markdown</th>
<td id="A2.T6.1.1.4.3.2" class="ltx_td ltx_align_center ltx_border_bb">0.254</td>
<td id="A2.T6.1.1.4.3.3" class="ltx_td ltx_align_center ltx_border_bb">0.167</td>
<td id="A2.T6.1.1.4.3.4" class="ltx_td ltx_align_center ltx_border_bb">0.143</td>
<td id="A2.T6.1.1.4.3.5" class="ltx_td ltx_align_center ltx_border_bb">0.121</td>
<td id="A2.T6.1.1.4.3.6" class="ltx_td ltx_align_center ltx_border_bb">0.175</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="A3" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix C </span>Lightweight Heuristics for Structural-anchor Proposal</h2>

<div id="A3.p1" class="ltx_para">
<p id="A3.p1.1" class="ltx_p">Initially, this method enumerates bounding lines by finding discrepancies in neighboring rows and columns based on differences in cell values, merged cells, borders, and fill color. In other words, it enumerates rows and columns with imbalances (text, merge, border, color, font, etc.). Rows and columns without significant discrepancies are usually canonical data rows or columns that contribute trivially to the layout understanding of a spreadsheet. Subsequently, it composes all possible candidate boundaries using any two rows and any two columns as top/bottom/left/right edges. In the third step, heuristics are applied to filter unreasonable boundary candidates by judging the integrity within each candidate boundary. For example, the proportion of numbers and characters in each row and column is used to infer the sparsity in the internal region and four edges of the candidate boundary. The size of the boundary is used to infer if it is too small to be a table, and the presence of header-like rows and columns is also considered. After this step, a small proportion of candidate boundaries are preserved.</p>
</div>
<div id="A3.p2" class="ltx_para">
<p id="A3.p2.1" class="ltx_p">In the fourth step, overlapping candidate boundaries are enumerated pairwise. Information such as the relative positions of candidate boundaries and the presence of headers is used to determine which candidate boundary more likely represents a table, thereby filtering out some overlapping boundaries. Figure <a href="#A3.F6" title="Figure 6 ‣ Appendix C Lightweight Heuristics for Structural-anchor Proposal ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">6</span></a> presents common overlapping patterns. For example, for two overlapping candidate boundaries with close top boundaries, heuristics use the proportion of textual cells or format strings like year and date to determine candidate headers. The existence of candidate headers is then used to decide which candidate boundary to filter out.</p>
</div>
<div id="A3.p3" class="ltx_para">
<p id="A3.p3.2" class="ltx_p">Finally, we take the remaining candidate boundaries to derive structural anchors. However, due to the challenge of fine-grained discriminating headers, titles, and notes for heuristics, the candidate boundaries produced by the above heuristics only achieve 46.3% F1 score in EoB-0 metric and 65.0% EoB-2 metric in our boundary detection test set.
Fortunately, including neighboring rows and columns largely increases the coverage of real bounding rows and columns, because headers, titles, and notes usually span few rows and columns. So we propose to not only use the exact bounding rows and columns as structural anchors but also include rows and columns within <math id="A3.p3.1.m1.1" class="ltx_Math" alttext="k" display="inline"><semantics id="A3.p3.1.m1.1a"><mi id="A3.p3.1.m1.1.1" xref="A3.p3.1.m1.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="A3.p3.1.m1.1b"><ci id="A3.p3.1.m1.1.1.cmml" xref="A3.p3.1.m1.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="A3.p3.1.m1.1c">k</annotation></semantics></math> rows and columns neighboring the structural anchors to preserve titles, notes, and headers as much as possible. This allows LLMs to further determine the exact boundaries by leveraging their advanced capabilities in semantic understanding and reasoning. When <math id="A3.p3.2.m2.1" class="ltx_Math" alttext="k" display="inline"><semantics id="A3.p3.2.m2.1a"><mi id="A3.p3.2.m2.1.1" xref="A3.p3.2.m2.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="A3.p3.2.m2.1b"><ci id="A3.p3.2.m2.1.1.cmml" xref="A3.p3.2.m2.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="A3.p3.2.m2.1c">k</annotation></semantics></math> is set to 4, over 97% of the border rows and columns in ground truth tables are preserved. This ensures that structure anchors rarely lose critical information of the table skeleton. The <span id="A3.p3.2.1" class="ltx_text ltx_font_bold">source code and an executable tool</span> to use this method can be found in the supplements to improve reproducibility.</p>
</div>
<figure id="A3.F6" class="ltx_figure"><img src="/html/2407.09025/assets/fig/heu.png" id="A3.F6.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="403" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 6: </span>Common overlapping patterns of candidate boundaries. </figcaption>
</figure>
</section>
<section id="A4" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix D </span>Ablation Experiment Results of Spreadsheet Table Detection</h2>

<section id="A4.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">D.1 </span>Results on Structure-anchor Threshold</h3>

<div id="A4.SS1.p1" class="ltx_para">
<p id="A4.SS1.p1.1" class="ltx_p">Table <a href="#A4.T7" title="Table 7 ‣ D.1 Results on Structure-anchor Threshold ‣ Appendix D Ablation Experiment Results of Spreadsheet Table Detection ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">7</span></a> details the ablation study concerning the number of rows and columns retained near candidate boundaries. Optimal results were observed when four rows/columns were preserved, yielding the highest F1 score across all datasets. This outcome is likely due to a balance between preserving essential boundary information and maintaining a feasible compression ratio. Retaining fewer rows/columns might omit critical boundaries, reducing Recall, while preserving more rows/columns diminishes the compression ratio, potentially exceeding the model’s token limits.</p>
</div>
<div id="A4.SS1.p2" class="ltx_para">
<p id="A4.SS1.p2.1" class="ltx_p">For smaller data, results indicate a positive correlation between the number of retained rows and the F1 score, suggesting that higher information retention leads to better model performance.</p>
</div>
<figure id="A4.T7" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 7: </span>Spreadsheet table detection Ablation on extracted threshold <math id="A4.T7.3.3.m1.1" class="ltx_Math" alttext="k" display="inline"><semantics id="A4.T7.3.3.m1.1b"><mi id="A4.T7.3.3.m1.1.1" xref="A4.T7.3.3.m1.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="A4.T7.3.3.m1.1c"><ci id="A4.T7.3.3.m1.1.1.cmml" xref="A4.T7.3.3.m1.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="A4.T7.3.3.m1.1d">k</annotation></semantics></math>. We present experiment results of three different <math id="A4.T7.4.4.m2.1" class="ltx_Math" alttext="k" display="inline"><semantics id="A4.T7.4.4.m2.1b"><mi id="A4.T7.4.4.m2.1.1" xref="A4.T7.4.4.m2.1.1.cmml">k</mi><annotation-xml encoding="MathML-Content" id="A4.T7.4.4.m2.1c"><ci id="A4.T7.4.4.m2.1.1.cmml" xref="A4.T7.4.4.m2.1.1">𝑘</ci></annotation-xml><annotation encoding="application/x-tex" id="A4.T7.4.4.m2.1d">k</annotation></semantics></math>: 2, 4, and 8 on fine-tuned GPT4.</figcaption>
<div id="A4.T7.5" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:181.0pt;height:55.4pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-27.0pt,8.3pt) scale(0.77,0.77) ;">
<table id="A4.T7.5.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A4.T7.5.1.1.1" class="ltx_tr">
<th id="A4.T7.5.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">k</th>
<th id="A4.T7.5.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="A4.T7.5.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="A4.T7.5.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="A4.T7.5.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="A4.T7.5.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A4.T7.5.1.2.1" class="ltx_tr">
<th id="A4.T7.5.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">2</th>
<td id="A4.T7.5.1.2.1.2" class="ltx_td ltx_nopad_l ltx_align_center ltx_border_t">0.775</td>
<td id="A4.T7.5.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.804</td>
<td id="A4.T7.5.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.686</td>
<td id="A4.T7.5.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.558</td>
<td id="A4.T7.5.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.712</td>
</tr>
<tr id="A4.T7.5.1.3.2" class="ltx_tr">
<th id="A4.T7.5.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">4</th>
<td id="A4.T7.5.1.3.2.2" class="ltx_td ltx_nopad_l ltx_align_center">0.810</td>
<td id="A4.T7.5.1.3.2.3" class="ltx_td ltx_align_center">0.832</td>
<td id="A4.T7.5.1.3.2.4" class="ltx_td ltx_align_center">0.718</td>
<td id="A4.T7.5.1.3.2.5" class="ltx_td ltx_align_center">0.690</td>
<td id="A4.T7.5.1.3.2.6" class="ltx_td ltx_align_center">0.759</td>
</tr>
<tr id="A4.T7.5.1.4.3" class="ltx_tr">
<th id="A4.T7.5.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">8</th>
<td id="A4.T7.5.1.4.3.2" class="ltx_td ltx_nopad_l ltx_align_center ltx_border_bb">0.788</td>
<td id="A4.T7.5.1.4.3.3" class="ltx_td ltx_align_center ltx_border_bb">0.824</td>
<td id="A4.T7.5.1.4.3.4" class="ltx_td ltx_align_center ltx_border_bb">0.773</td>
<td id="A4.T7.5.1.4.3.5" class="ltx_td ltx_align_center ltx_border_bb">0.400</td>
<td id="A4.T7.5.1.4.3.6" class="ltx_td ltx_align_center ltx_border_bb">0.744</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="A4.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">D.2 </span>Results of Spreadsheet Table Detection on ICL</h3>

<div id="A4.SS2.p1" class="ltx_para">
<p id="A4.SS2.p1.1" class="ltx_p">We conducted experiments on the GPT4, "GPT4-0125-preview" version. As shown in Table <a href="#A4.T8" title="Table 8 ‣ D.2 Results of Spreadsheet Table Detection on ICL ‣ Appendix D Ablation Experiment Results of Spreadsheet Table Detection ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">8</span></a>, the results are consistent with the conclusions we draw from our fine-tuned experiments.</p>
</div>
<figure id="A4.T8" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 8: </span>Ablation experiment results on ICL on spreadsheet table detection. Our compression method also achieved the best F1 score on ICL.</figcaption>
<div id="A4.T8.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:234.6pt;height:67.5pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-39.1pt,11.3pt) scale(0.75,0.75) ;">
<table id="A4.T8.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A4.T8.1.1.1.1" class="ltx_tr">
<th id="A4.T8.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Model</th>
<th id="A4.T8.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="A4.T8.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="A4.T8.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="A4.T8.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="A4.T8.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A4.T8.1.1.2.1" class="ltx_tr">
<th id="A4.T8.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">GPT4-compress</th>
<td id="A4.T8.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.480</td>
<td id="A4.T8.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.454</td>
<td id="A4.T8.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.373</td>
<td id="A4.T8.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.330</td>
<td id="A4.T8.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.410</td>
</tr>
<tr id="A4.T8.1.1.3.2" class="ltx_tr">
<th id="A4.T8.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Aggregation</th>
<td id="A4.T8.1.1.3.2.2" class="ltx_td ltx_align_center">0.386</td>
<td id="A4.T8.1.1.3.2.3" class="ltx_td ltx_align_center">0.271</td>
<td id="A4.T8.1.1.3.2.4" class="ltx_td ltx_align_center">0.215</td>
<td id="A4.T8.1.1.3.2.5" class="ltx_td ltx_align_center">0.267</td>
<td id="A4.T8.1.1.3.2.6" class="ltx_td ltx_align_center">0.280</td>
</tr>
<tr id="A4.T8.1.1.4.3" class="ltx_tr">
<th id="A4.T8.1.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Translation</th>
<td id="A4.T8.1.1.4.3.2" class="ltx_td ltx_align_center">0.386</td>
<td id="A4.T8.1.1.4.3.3" class="ltx_td ltx_align_center">0.427</td>
<td id="A4.T8.1.1.4.3.4" class="ltx_td ltx_align_center">0.338</td>
<td id="A4.T8.1.1.4.3.5" class="ltx_td ltx_align_center">0.418</td>
<td id="A4.T8.1.1.4.3.6" class="ltx_td ltx_align_center">0.379</td>
</tr>
<tr id="A4.T8.1.1.5.4" class="ltx_tr">
<th id="A4.T8.1.1.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">   -w/o Extraction</th>
<td id="A4.T8.1.1.5.4.2" class="ltx_td ltx_align_center ltx_border_bb">0.345</td>
<td id="A4.T8.1.1.5.4.3" class="ltx_td ltx_align_center ltx_border_bb">0.263</td>
<td id="A4.T8.1.1.5.4.4" class="ltx_td ltx_align_center ltx_border_bb">0.198</td>
<td id="A4.T8.1.1.5.4.5" class="ltx_td ltx_align_center ltx_border_bb">0.268</td>
<td id="A4.T8.1.1.5.4.6" class="ltx_td ltx_align_center ltx_border_bb">0.257</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
</section>
<section id="A5" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix E </span>Spreadsheet Table Detection Test Dataset Quality Improvement Pipeline</h2>

<div id="A5.p1" class="ltx_para">
<p id="A5.p1.1" class="ltx_p">The quality improvement pipeline on the test set consists of the following steps:
(1) excluding those spreadsheets where at least one cell contains languages beyond English; (2) removing spreadsheets in the test set that lie in the same workbook as at least one spreadsheet in the training set, because spreadsheets in the same workbook, though different, are often similar; (3) annotating all spreadsheets in three types: type 1 means certain for one label; type 2 means multiple labels are reasonable; type 3 means not certain. We employ five well-educated annotators from top universities with majors in computer science to undertake this quality improvement. For each spreadsheet in the test set, we aggregate the annotations from all five annotators and preserve multiple reasonable labeling results for type 2 spreadsheets.</p>
</div>
<div id="A5.p2" class="ltx_para">
<p id="A5.p2.1" class="ltx_p">As a result, we obtained a well-annotated dataset with 167 spreadsheets containing 268 tables for type 1, 21 spreadsheets with 43 tables for type 2, and 10 spreadsheets for type 3. All the raw files and labels of the test set are attached to the supplements. We selected data labeled as type 1 and type 2 as the test set, comprising a total of 188 entries.</p>
</div>
</section>
<section id="A6" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix F </span>Spreadsheet Table Detection Test Dataset Partition</h2>

<div id="A6.p1" class="ltx_para">
<p id="A6.p1.1" class="ltx_p">From the spreadsheet raw file, we can extract various features, including cell address, value, format (background color, bold, borders, etc.), and more. We transformed these features into the markdown-like style in Section<a href="#S3.SS1" title="3.1 Vanilla Spreadsheet Encoding with Cell Value, Address, and Format ‣ 3 Method ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3.1</span></a>. Then, based on the number of tokens after encoding and the length of the context window of the test model, we divided them into four categories: small (number of tokens less than 4k), medium (4-8k), large (8-32k), and huge (greater than 32k). The following is an example of data in Markdown with format information.</p>
</div>
<div id="A6.p2" class="ltx_para">
<p id="A6.p2.1" class="ltx_p"><span id="A6.p2.1.1" class="ltx_text ltx_font_bold">Example: Encoding Spreadsheet in Markdown-like Style with Cell Formats</span>

<span id="A6.p2.1.2" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A6.p2.1.2.1" class="ltx_p">Text Input:
<br class="ltx_break">B2,Table 4: Diesel-driven passenger cars, 2015|C2, |D2, |E2, |F2, |G2, |H2, 
<br class="ltx_break">B3, |C3, |D3, |E3, |F3, |G3, |H3, 
<br class="ltx_break">B4, |C4, |D4, |E4, |F4, |G4, |H4, 
<br class="ltx_break">|B5, |C5,Diesel engine|D5, |E5, |F5,Share of all passenger cars (%)|G5, |H5,</span>
<span id="A6.p2.1.2.2" class="ltx_p">……</span>
<span id="A6.p2.1.2.3" class="ltx_p">Format Input:</span>
<span id="A6.p2.1.2.4" class="ltx_p">|B2,Font Bold|C2, |D2, |E2, |F2, |G2, |H2, 
<br class="ltx_break">|B3, |C3, |D3, |E3, |F3, |G3, |H3, 
<br class="ltx_break">|B4,Bottom Border,|C4,Bottom Border,|D4,Bottom Border,|E4,Bottom Border,|F4,Bottom Border,|G4,Bottom Border,|H4,Bottom Border,
<br class="ltx_break">|B5,Top Border,Right Border,Fill Color,Font Bold|C5,Top Border,Bottom Border,Left Border,Fill Color,Font Bold|D5,Top Border,Bottom Border,Fill Color,Font Bold|E5,Top Border,Bottom Border,Right Border,Fill Color,Font Bold|F5,Top Border,Bottom Border,Left Border,Fill Color,Font Bold|G5,Top Border,Bottom Border,Fill Color,Font Bold|H5,Top Border,Bottom Border,Fill Color,Font Bold
<br class="ltx_break">……</span>
</span></p>
</div>
</section>
<section id="A7" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix G </span>Experiment Setup</h2>

<div id="A7.p1" class="ltx_para">
<p id="A7.p1.1" class="ltx_p">Open-source model using Deepspeed for distributed training on a workstation with 8 A100 GPUs by LoRA.</p>
</div>
<div id="A7.p2" class="ltx_para">
<p id="A7.p2.1" class="ltx_p"><span id="A7.p2.1.1" class="ltx_text ltx_font_bold">Llama2:</span>meta-Llama/Llama-2-7b-chat-hf;</p>
</div>
<div id="A7.p3" class="ltx_para">
<p id="A7.p3.1" class="ltx_p"><span id="A7.p3.1.1" class="ltx_text ltx_font_bold">Llama3:</span>meta-Llama/Meta-Llama-3-8B-Instruct;</p>
</div>
<div id="A7.p4" class="ltx_para">
<p id="A7.p4.1" class="ltx_p"><span id="A7.p4.1.1" class="ltx_text ltx_font_bold">Mistral-v2:</span>mistralai/Mistral-v2-7B-Instruct-v0.2;</p>
</div>
<div id="A7.p5" class="ltx_para">
<p id="A7.p5.1" class="ltx_p"><span id="A7.p5.1.1" class="ltx_text ltx_font_bold">Phi3:</span>microsoft/Phi-3-mini-128k-instruct;</p>
</div>
<section id="A7.SS0.SSS0.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">The parameters of open-source model fine-tuning:</h5>

<div id="A7.SS0.SSS0.Px1.p1" class="ltx_para">
<p id="A7.SS0.SSS0.Px1.p1.1" class="ltx_p">cutoff len=5800;
learning rate=5e-05;
num train epochs=15.0;
train batch size=5;
gradient accumulation steps=8;
lr scheduler type is cosine;
max grad norm=1.0;
warmup steps=0;
optim is AdamW;
precision is fp16;
lora rank=32;
lora alpha=64;
lora dropout=0.01;
val size=0.0008;
eval steps=50;
eval batch size=5</p>
</div>
</section>
<section id="A7.SS0.SSS0.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">The parameters of GPT4/3.5 model fine-tuning:</h5>

<div id="A7.SS0.SSS0.Px2.p1" class="ltx_para">
<p id="A7.SS0.SSS0.Px2.p1.1" class="ltx_p">We have attached the fine-tuned file and parameters in the Supplementary materials.</p>
</div>
</section>
<section id="A7.SS0.SSS0.Px3" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">The parameters of GPT4/3.5 model inference:</h5>

<div id="A7.SS0.SSS0.Px3.p1" class="ltx_para">
<p id="A7.SS0.SSS0.Px3.p1.1" class="ltx_p">temperature=0, max tokens=300, top p=0.95, frequency penalty=0, presence penalty= 0, stop=None, and the rest are default settings.</p>
</div>
</section>
</section>
<section id="A8" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix H </span>Spreadsheet QA Test Dataset</h2>

<section id="A8.SS0.SSS0.Px1" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Overall Description</h5>

<div id="A8.SS0.SSS0.Px1.p1" class="ltx_para">
<p id="A8.SS0.SSS0.Px1.p1.1" class="ltx_p">The dataset of 64 spreadsheets includes 9 single table spreadsheets, 35 double table spreadsheets, 11 spreadsheets containing three tables, and 9 spreadsheets containing four or more tables. Among them, 15 spreadsheets contain fewer than 4k tokens, 20 contain between 4k and 8k, 22 contain between 8k and 32k, and 7 contain more than 32k.</p>
</div>
</section>
<section id="A8.SS0.SSS0.Px2" class="ltx_paragraph">
<h5 class="ltx_title ltx_title_paragraph">Details of the Dataset Collection </h5>

<div id="A8.SS0.SSS0.Px2.p1" class="ltx_para">
<p id="A8.SS0.SSS0.Px2.p1.1" class="ltx_p">We selected English-language spreadsheets and invited five well-educated professional annotators to annotate the data.
During selection, spreadsheets containing non-ASCII characters or lacking necessary semantic comprehension information were excluded.
We ensured that the questions could be answered with relative certainty using the information provided in the tables, minimizing the potential confusion or ambiguity. To further validate the quality of the dataset, we invited two additional annotators to perform cross-verification after the initial question-answer labeling process, ensuring the correctness and rationality of the answers. It shows an answer accuracy of 0.846 in Fleiss Kappa, indicating almost perfect agreement.</p>
</div>
<div id="A8.SS0.SSS0.Px2.p2" class="ltx_para">
<p id="A8.SS0.SSS0.Px2.p2.1" class="ltx_p"><span id="A8.SS0.SSS0.Px2.p2.1.1" class="ltx_text ltx_font_bold">Example: Spreadsheet QA Data Item</span></p>
</div>
<div id="A8.SS0.SSS0.Px2.p3" class="ltx_para">
<span id="A8.SS0.SSS0.Px2.p3.1" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A8.SS0.SSS0.Px2.p3.1.1" class="ltx_p">QUESTION: "What were the highest temperatures in Washington DC in 1998?"</span>
<span id="A8.SS0.SSS0.Px2.p3.1.2" class="ltx_p">GROUNDTRUTH:
"X23 AND X24"</span>
<span id="A8.SS0.SSS0.Px2.p3.1.3" class="ltx_p">PROMPT:
[Instruction + Encoded Spreadsheet]</span>
</span>
</div>
</section>
</section>
<section id="A9" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix I </span>Cost calculation</h2>

<div id="A9.p1" class="ltx_para">
<p id="A9.p1.1" class="ltx_p">We use the ICL price of GPT4 due to the absence of fine-tuned GPT4’s price. We neglect the output sequence since it is much shorter than the input sequence in tasks like spreadsheet boundary detection and QA.
The average cost of processing a spreadsheet in our test set has decreased to $0.000157 (62000/198 * 0.0005 / 1000) from $0.00391 (1548000/198 * 0.0005 / 1000) for the GPT3.5 turbo, and to $0.00939 (62000/198 * 0.03 / 1000) from $0.235 (1548000/198 * 0.03 / 1000) for the GPT4, saving an impressive 96.0% in costs. The cost reduction similarly applies to all LLMs we used.</p>
</div>
</section>
<section id="A10" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix J </span>Other Experimental Results</h2>

<section id="A10.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">J.1 </span>Compression Results</h3>

<div id="A10.SS1.p1" class="ltx_para">
<p id="A10.SS1.p1.1" class="ltx_p">Table <a href="#A10.T9" title="Table 9 ‣ J.1 Compression Results ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">9</span></a> shows the compression ratio of each stage in our method relative to the previous stage.</p>
</div>
<figure id="A10.T9" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 9: </span>Compression Ratio of Data Region. </figcaption>
<div id="A10.T9.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:216.5pt;height:32.1pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-73.7pt,10.9pt) scale(0.595,0.595) ;">
<table id="A10.T9.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A10.T9.1.1.1.1" class="ltx_tr">
<th id="A10.T9.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Metric</th>
<th id="A10.T9.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">No Modules</th>
<th id="A10.T9.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1</th>
<th id="A10.T9.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1&amp;2</th>
<th id="A10.T9.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Module 1&amp;2&amp;3</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A10.T9.1.1.2.1" class="ltx_tr">
<th id="A10.T9.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">Total Tokens</th>
<td id="A10.T9.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">1,548,577</td>
<td id="A10.T9.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">350,946</td>
<td id="A10.T9.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">103,880</td>
<td id="A10.T9.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">62,469</td>
</tr>
<tr id="A10.T9.1.1.3.2" class="ltx_tr">
<th id="A10.T9.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">Compression Ratio</th>
<td id="A10.T9.1.1.3.2.2" class="ltx_td ltx_align_center ltx_border_bb">1.00</td>
<td id="A10.T9.1.1.3.2.3" class="ltx_td ltx_align_center ltx_border_bb">4.41</td>
<td id="A10.T9.1.1.3.2.4" class="ltx_td ltx_align_center ltx_border_bb">3.38</td>
<td id="A10.T9.1.1.3.2.5" class="ltx_td ltx_align_center ltx_border_bb">1.66</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
<div id="A10.SS1.p2" class="ltx_para">
<p id="A10.SS1.p2.1" class="ltx_p">Table <a href="#A10.T10" title="Table 10 ‣ J.1 Compression Results ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">10</span></a> shows the total compression ratio of train and valid datasets.</p>
</div>
<figure id="A10.T10" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 10: </span>Compression performance on train &amp; valid Datasets. </figcaption>
<div id="A10.T10.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:166.8pt;height:100.8pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-20.9pt,12.6pt) scale(0.8,0.8) ;">
<table id="A10.T10.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<tbody class="ltx_tbody">
<tr id="A10.T10.1.1.1.1" class="ltx_tr">
<th id="A10.T10.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_tt">Metric</th>
<td id="A10.T10.1.1.1.1.2" class="ltx_td ltx_align_center ltx_border_tt">Before</td>
<td id="A10.T10.1.1.1.1.3" class="ltx_td ltx_align_center ltx_border_tt">After</td>
</tr>
<tr id="A10.T10.1.1.2.2" class="ltx_tr">
<th id="A10.T10.1.1.2.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" colspan="3"><span id="A10.T10.1.1.2.2.1.1" class="ltx_text ltx_font_bold">Valid Datasets (200 items)</span></th>
</tr>
<tr id="A10.T10.1.1.3.3" class="ltx_tr">
<th id="A10.T10.1.1.3.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">Tokens</th>
<td id="A10.T10.1.1.3.3.2" class="ltx_td ltx_align_center ltx_border_t">1,462,076</td>
<td id="A10.T10.1.1.3.3.3" class="ltx_td ltx_align_center ltx_border_t">99,411</td>
</tr>
<tr id="A10.T10.1.1.4.4" class="ltx_tr">
<th id="A10.T10.1.1.4.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">Compress Ratio</th>
<td id="A10.T10.1.1.4.4.2" class="ltx_td ltx_align_center">1.00</td>
<td id="A10.T10.1.1.4.4.3" class="ltx_td ltx_align_center">14.71</td>
</tr>
<tr id="A10.T10.1.1.5.5" class="ltx_tr">
<th id="A10.T10.1.1.5.5.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_t" colspan="3"><span id="A10.T10.1.1.5.5.1.1" class="ltx_text ltx_font_bold">Train Datasets (7000 items)</span></th>
</tr>
<tr id="A10.T10.1.1.6.6" class="ltx_tr">
<th id="A10.T10.1.1.6.6.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">Tokens</th>
<td id="A10.T10.1.1.6.6.2" class="ltx_td ltx_align_center ltx_border_t">192,879,819</td>
<td id="A10.T10.1.1.6.6.3" class="ltx_td ltx_align_center ltx_border_t">11,392,870</td>
</tr>
<tr id="A10.T10.1.1.7.7" class="ltx_tr">
<th id="A10.T10.1.1.7.7.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">Compress Ratio</th>
<td id="A10.T10.1.1.7.7.2" class="ltx_td ltx_align_center ltx_border_bb">1.00</td>
<td id="A10.T10.1.1.7.7.3" class="ltx_td ltx_align_center ltx_border_bb">16.93</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="A10.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">J.2 </span>The ICL results of open-source models on spreadsheet table detection.</h3>

<div id="A10.SS2.p1" class="ltx_para">
<p id="A10.SS2.p1.1" class="ltx_p">Table <a href="#A10.T11" title="Table 11 ‣ J.2 The ICL results of open-source models on spreadsheet table detection. ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">11</span></a> shows the ICL experiments’ F1 score of open-source models on the spreadsheet table detection task. In this experimental setting, the open-source model performs far worse than the closed-source model.</p>
</div>
<figure id="A10.T11" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 11: </span>The ICL results of open-source models’ performance on spreadsheet table detection.</figcaption>
<div id="A10.T11.1" class="ltx_inline-block ltx_align_center ltx_transformed_outer" style="width:216.7pt;height:72pt;vertical-align:-0.0pt;"><span class="ltx_transformed_inner" style="transform:translate(-27.1pt,9.0pt) scale(0.8,0.8) ;">
<table id="A10.T11.1.1" class="ltx_tabular ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A10.T11.1.1.1.1" class="ltx_tr">
<th id="A10.T11.1.1.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Model</th>
<th id="A10.T11.1.1.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Small</th>
<th id="A10.T11.1.1.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Medium</th>
<th id="A10.T11.1.1.1.1.4" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Large</th>
<th id="A10.T11.1.1.1.1.5" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Huge</th>
<th id="A10.T11.1.1.1.1.6" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">All</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A10.T11.1.1.2.1" class="ltx_tr">
<th id="A10.T11.1.1.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">Llama3</th>
<td id="A10.T11.1.1.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.042</td>
<td id="A10.T11.1.1.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.028</td>
<td id="A10.T11.1.1.2.1.4" class="ltx_td ltx_align_center ltx_border_t">0.020</td>
<td id="A10.T11.1.1.2.1.5" class="ltx_td ltx_align_center ltx_border_t">0.018</td>
<td id="A10.T11.1.1.2.1.6" class="ltx_td ltx_align_center ltx_border_t">0.027</td>
</tr>
<tr id="A10.T11.1.1.3.2" class="ltx_tr">
<th id="A10.T11.1.1.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">Llama2</th>
<td id="A10.T11.1.1.3.2.2" class="ltx_td ltx_align_center">0.062</td>
<td id="A10.T11.1.1.3.2.3" class="ltx_td ltx_align_center">0.023</td>
<td id="A10.T11.1.1.3.2.4" class="ltx_td ltx_align_center">0.038</td>
<td id="A10.T11.1.1.3.2.5" class="ltx_td ltx_align_center">0.027</td>
<td id="A10.T11.1.1.3.2.6" class="ltx_td ltx_align_center">0.041</td>
</tr>
<tr id="A10.T11.1.1.4.3" class="ltx_tr">
<th id="A10.T11.1.1.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">Phi3</th>
<td id="A10.T11.1.1.4.3.2" class="ltx_td ltx_align_center">0.037</td>
<td id="A10.T11.1.1.4.3.3" class="ltx_td ltx_align_center">0.040</td>
<td id="A10.T11.1.1.4.3.4" class="ltx_td ltx_align_center">0.041</td>
<td id="A10.T11.1.1.4.3.5" class="ltx_td ltx_align_center">0.000</td>
<td id="A10.T11.1.1.4.3.6" class="ltx_td ltx_align_center">0.034</td>
</tr>
<tr id="A10.T11.1.1.5.4" class="ltx_tr">
<th id="A10.T11.1.1.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">Mistral-v2</th>
<td id="A10.T11.1.1.5.4.2" class="ltx_td ltx_align_center ltx_border_bb">0.071</td>
<td id="A10.T11.1.1.5.4.3" class="ltx_td ltx_align_center ltx_border_bb">0.013</td>
<td id="A10.T11.1.1.5.4.4" class="ltx_td ltx_align_center ltx_border_bb">0.029</td>
<td id="A10.T11.1.1.5.4.5" class="ltx_td ltx_align_center ltx_border_bb">0.017</td>
<td id="A10.T11.1.1.5.4.6" class="ltx_td ltx_align_center ltx_border_bb">0.036</td>
</tr>
</tbody>
</table>
</span></div>
</figure>
</section>
<section id="A10.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">J.3 </span>Spreadsheet QA Ablation Experiment</h3>

<figure id="A10.T12" class="ltx_table">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_table">Table 12: </span>Each module of <span id="A10.T12.2.1" class="ltx_text ltx_font_smallcaps">SheetCompressor</span> contributes to the positive outcomes on Spreadsheet QA. "Answer" represents the accuracy of answering questions, and "Region" represents the accuracy of predicting relevant regions in CoS.</figcaption>
<table id="A10.T12.3" class="ltx_tabular ltx_centering ltx_guessed_headers ltx_align_middle">
<thead class="ltx_thead">
<tr id="A10.T12.3.1.1" class="ltx_tr">
<th id="A10.T12.3.1.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_column ltx_th_row ltx_border_r ltx_border_tt">Model</th>
<th id="A10.T12.3.1.1.2" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Answer</th>
<th id="A10.T12.3.1.1.3" class="ltx_td ltx_align_center ltx_th ltx_th_column ltx_border_tt">Region</th>
</tr>
</thead>
<tbody class="ltx_tbody">
<tr id="A10.T12.3.2.1" class="ltx_tr">
<th id="A10.T12.3.2.1.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r ltx_border_t">GPT4-compress</th>
<td id="A10.T12.3.2.1.2" class="ltx_td ltx_align_center ltx_border_t">0.743</td>
<td id="A10.T12.3.2.1.3" class="ltx_td ltx_align_center ltx_border_t">0.974</td>
</tr>
<tr id="A10.T12.3.3.2" class="ltx_tr">
<th id="A10.T12.3.3.2.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Extraction</th>
<td id="A10.T12.3.3.2.2" class="ltx_td ltx_align_center">0.716</td>
<td id="A10.T12.3.3.2.3" class="ltx_td ltx_align_center">0.892</td>
</tr>
<tr id="A10.T12.3.4.3" class="ltx_tr">
<th id="A10.T12.3.4.3.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_r">   -w/o Translation</th>
<td id="A10.T12.3.4.3.2" class="ltx_td ltx_align_center">0.719</td>
<td id="A10.T12.3.4.3.3" class="ltx_td ltx_align_center">0.925</td>
</tr>
<tr id="A10.T12.3.5.4" class="ltx_tr">
<th id="A10.T12.3.5.4.1" class="ltx_td ltx_align_left ltx_th ltx_th_row ltx_border_bb ltx_border_r">   -w/o Aggregation</th>
<td id="A10.T12.3.5.4.2" class="ltx_td ltx_align_center ltx_border_bb">0.726</td>
<td id="A10.T12.3.5.4.3" class="ltx_td ltx_align_center ltx_border_bb">0.928</td>
</tr>
</tbody>
</table>
</figure>
<div id="A10.SS3.p1" class="ltx_para">
<p id="A10.SS3.p1.1" class="ltx_p">Table <a href="#A10.T12" title="Table 12 ‣ J.3 Spreadsheet QA Ablation Experiment ‣ Appendix J Other Experimental Results ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">12</span></a> assesses the impact of removing individual modules on the QA performance. It details both the overall accuracy and the accuracy of identifying question-related regions during the CoT process. The removal of any module generally leads to a decrease in both metrics, with the most significant drop observed when the extraction module is omitted. This is likely due to the extraction module achieving the lowest compression ratio (see Table <a href="#S4.T1" title="Table 1 ‣ 4.2.1 Dataset ‣ 4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>), suggesting that a longer context may hinder the model’s ability to accurately interpret the data.</p>
</div>
</section>
</section>
<section id="A11" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix K </span>Case Study</h2>

<section id="A11.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">K.1 </span>Comparison of results before and after structural-anchor-based extraction</h3>

<figure id="A11.F7" class="ltx_figure"><img src="/html/2407.09025/assets/fig/case1.png" id="A11.F7.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="324" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 7: </span>The results before and after structural-anchor-based extraction. </figcaption>
</figure>
<div id="A11.SS1.p1" class="ltx_para">
<p id="A11.SS1.p1.1" class="ltx_p">The case described in Figure. <a href="#A11.F7" title="Figure 7 ‣ K.1 Comparison of results before and after structural-anchor-based extraction ‣ Appendix K Case Study ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">7</span></a> illustrates the results of GPT4-FT before and after structural-anchor-based extraction. Specifically, before structural-anchor-based extraction, most of the content in the spreadsheet is concentrated in the first two rows and the three columns on the left and right, leaving the middle largely empty. This led GPT4 to incorrectly predict the presence of two tables, "B2:AK14" and "B19:F25." However, after applying structural-anchor-based extraction, the spreadsheet’s structure becomes more compact, making it easier for GPT4 to correctly predict the table’s range as "B2:M20" after coordinating rearrangement.</p>
</div>
<div id="A11.SS1.p2" class="ltx_para">
<p id="A11.SS1.p2.1" class="ltx_p">From this case, we can observe that for spreadsheets with sparse structures and many empty cells, structural-anchor-based extraction not only significantly reduces the number of tokens but also effectively enhances GPT4’s ability in table detection.</p>
</div>
</section>
<section id="A11.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">K.2 </span>Comparison of results before and after inverted-index translation</h3>

<figure id="A11.F8" class="ltx_figure"><img src="/html/2407.09025/assets/fig/case2.png" id="A11.F8.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="224" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 8: </span>The results before and after inverted-index translation.</figcaption>
</figure>
<div id="A11.SS2.p1" class="ltx_para">
<p id="A11.SS2.p1.1" class="ltx_p">The case described in Figure. <a href="#A11.F8" title="Figure 8 ‣ K.2 Comparison of results before and after inverted-index translation ‣ Appendix K Case Study ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">8</span></a> demonstrates the results of GPT4-FT before and after inverted-index translation. Specifically, before the inverted-index translation, the spreadsheet contained two tables with identical column headers placed closely together, causing GPT4 to mistakenly predict them as one large table, "B1:D14." However, after inverted-index translation, GPT4 was able to aggregate cells with shared values, thereby recognizing semantic relationships between non-adjacent rows and columns. This enabled it to correctly identify the two separate tables in the spreadsheet, "B1:D10" and "B11:D14".</p>
</div>
<div id="A11.SS2.p2" class="ltx_para">
<p id="A11.SS2.p2.1" class="ltx_p">This case indicates that inverted-index translation, by aggregating cells with shared values, not only reduces token redundancy to some extent but also leverages the model’s robust understanding of semantic relationships.</p>
</div>
</section>
<section id="A11.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">K.3 </span>Comparison of results before and after data-format-aware cell aggregation</h3>

<figure id="A11.F9" class="ltx_figure"><img src="/html/2407.09025/assets/fig/case3.png" id="A11.F9.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="428" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 9: </span>The results before and after data-aware cell aggregation.</figcaption>
</figure>
<div id="A11.SS3.p1" class="ltx_para">
<p id="A11.SS3.p1.1" class="ltx_p">The case presented in Figure. <a href="#A11.F9" title="Figure 9 ‣ K.3 Comparison of results before and after data-format-aware cell aggregation ‣ Appendix K Case Study ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">9</span></a> showcases the results of GPT4-FT before and after data-aware cell aggregation. Specifically, before data-aware cell aggregation, the spreadsheet contained two columns with values of the same data type, occupying a large number of tokens. The first column increased incrementally by date, while the second column increased incrementally by value. After data-aware cell aggregation, the dates in the first column were replaced with the format string "yyyy/mm/dd" and their addresses were aggregated. Similarly, numerical values were handled with a "FloatNum" format. This method allowed the model to predict the table range correctly as "B1:C38," both before and after processing, indicating that this approach significantly reduces the token count while preserving the semantic information of the spreadsheet data.</p>
</div>
</section>
<section id="A11.SS4" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">K.4 </span>Comparison of <span id="A11.SS4.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> and TableSense-CNN</h3>

<figure id="A11.F10" class="ltx_figure"><img src="/html/2407.09025/assets/fig/case_compare1.png" id="A11.F10.g1" class="ltx_graphics ltx_centering ltx_img_landscape" width="598" height="244" alt="Refer to caption">
<figcaption class="ltx_caption ltx_centering"><span class="ltx_tag ltx_tag_figure">Figure 10: </span>A challenging case. Traditional spreadsheet understanding methods usually miss the region "R5:R14", but this column has a semantic relationship with the left cells, representing the percentage of those values in left cells.</figcaption>
</figure>
<div id="A11.SS4.p1" class="ltx_para">
<p id="A11.SS4.p1.1" class="ltx_p">As shown in Figure <a href="#A11.F10" title="Figure 10 ‣ K.4 Comparison of SpreadsheetLLM and TableSense-CNN ‣ Appendix K Case Study ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">10</span></a>, the output of TableSense-CNN is [A1:G44,K5:M14,K16:M38,Q20:W29], while the output of <span id="A11.SS4.p1.1.1" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> is [A1:G44,K5:<span id="A11.SS4.p1.1.2" class="ltx_text ltx_font_bold">R</span>14,K16:M38,Q20:W29]. <span id="A11.SS4.p1.1.3" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> succeeds in adding the region "R5:R14" to the table2. Though it is spatially distant from the table on the left, <span id="A11.SS4.p1.1.4" class="ltx_text ltx_font_smallcaps">SpreadsheetLLM</span> can extract the connections from cells’ semantic and structural relationship, which demonstrates its powerful reasoning ability.</p>
</div>
</section>
</section>
<section id="A12" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix L </span>Prompt Template</h2>

<div id="A12.p1" class="ltx_para">
<p id="A12.p1.1" class="ltx_p">In this section, we present the prompt templates for the Spreadsheet Table Detection and Spreadsheet QA tasks.</p>
</div>
<section id="A12.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">L.1 </span>Vanilla Prompt Template for Spreadsheet Table Detection</h3>

<div id="A12.SS1.p1" class="ltx_para">
<p id="A12.SS1.p1.1" class="ltx_p"><span id="A12.SS1.p1.1.1" class="ltx_text ltx_font_bold">A Vanilla Prompt Template for Spreadsheet Table Detection:</span>

<span id="A12.SS1.p1.1.2" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS1.p1.1.2.1" class="ltx_p">INSTRUCTION:</span>
<span id="A12.SS1.p1.1.2.2" class="ltx_p">Given an input that is a string denoting data of cells in a spreadsheet. The input spreadsheet includes many pairs, and each pair consists of a cell address and the text in that cell with a ’,’ in between, like ’A1,Year’. Cells are separated by ’|’ like ’A1,Year|A2,Profit’. The text can be empty so the cell data is like ’A1, |A2,Profit’. The cells are organized in row-major order. Now you should tell me the range of the table in a format like A2:D5, and the range of the table should only CONTAIN HEADER REGION and the data region, DON’T include the title or comments. Note that there can be more than one table in the string, so you should return all the RANGE, LIKE [’range’: ’A1:F9’, ’range’: ’A12:F18’]. DON’T ADD OTHER WORDS OR EXPLANATION.</span>
<span id="A12.SS1.p1.1.2.3" class="ltx_p">INPUT:</span>
<span id="A12.SS1.p1.1.2.4" class="ltx_p">[Encoded Spreadsheet]</span>
</span></p>
</div>
</section>
<section id="A12.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">L.2 </span>Prompt Template for Spreadsheet Table Detection</h3>

<div id="A12.SS2.p1" class="ltx_para">
<p id="A12.SS2.p1.1" class="ltx_p"><span id="A12.SS2.p1.1.1" class="ltx_text ltx_font_bold ltx_font_smallcaps">SpreadsheetLLM<span id="A12.SS2.p1.1.1.1" class="ltx_text ltx_font_upright"> Prompt Template for Spreadsheet Table Detection:</span></span></p>
</div>
<div id="A12.SS2.p2" class="ltx_para">
<span id="A12.SS2.p2.1" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS2.p2.1.1" class="ltx_p">INSTRUCTION:</span>
<span id="A12.SS2.p2.1.2" class="ltx_p">Given an input that is a string denoting data of cells in an Excel spreadsheet. The input spreadsheet contains many tuples, describing the cells with content in the spreadsheet.
Each tuple consists of two elements separated by a ’|’: the cell content and the cell address/region, like (Year|A1), ( |A1) or (IntNum|A1:B3). The content in some cells such as ’#,##0’/’d-mmm-yy’/’H:mm:ss’,etc., represents the CELL DATA FORMATS of Excel. The content in some cells such as ’IntNum’/’DateData’/’EmailData’,etc., represents a category of data with the same format and similar semantics. For example, ’IntNum’ represents integer type data, and ’ScientificNum’ represents scientific notation type data. ’A1:B3’ represents a region in a spreadsheet, from the first row to the third row and from column A to column B. Some cells with empty content in the spreadsheet are not entered. Now you should tell me the range of the table in a format like A2:D5, and the range of the table should only CONTAIN HEADER REGION and the data region. DON’T include the title or comments.
Note that there can be more than one table in a string, so you should return all the RANGE.</span>
</span>
<span id="A12.SS2.p2.2" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS2.p2.2.1" class="ltx_p">DON’T ADD OTHER WORDS OR EXPLANATION.</span>
<span id="A12.SS2.p2.2.2" class="ltx_p">INPUT:</span>
<span id="A12.SS2.p2.2.3" class="ltx_p">[Encoded Spreadsheet]</span>
</span>
</div>
</section>
<section id="A12.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">L.3 </span>Prompt Template for Spreadsheet QA</h3>

<div id="A12.SS3.p1" class="ltx_para">
<p id="A12.SS3.p1.1" class="ltx_p">As detailed in Section <a href="#S4.SS2" title="4.2 Spreadsheet QA ‣ 4 Experiments ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.2</span></a>, the CoS method includes two stages, and the prompts for each stage are as follows:</p>
</div>
<div id="A12.SS3.p2" class="ltx_para">
<p id="A12.SS3.p2.1" class="ltx_p"><span id="A12.SS3.p2.1.1" class="ltx_text ltx_font_bold">Spreadsheet QA Prompt Template:</span></p>
</div>
<div id="A12.SS3.p3" class="ltx_para">
<span id="A12.SS3.p3.1" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS3.p3.1.1" class="ltx_p"><span id="A12.SS3.p3.1.1.1" class="ltx_text ltx_font_bold">Stage 1:</span></span>
<span id="A12.SS3.p3.1.2" class="ltx_p">INSTRUCTION:</span>
<span id="A12.SS3.p3.1.3" class="ltx_p">Given an input that is a string denoting data of cells in a table. The input table contains many tuples, describing the cells with content in the spreadsheet. Each tuple consists of two elements separated by a ’|’: the cell content and the cell address/region, like (Year|A1), ( |A1) or (IntNum|A1:B3). The content in some cells such as ’#,##0’/’d-mmm-yy’/’H:mm:ss’,etc., represents the CELL DATA FORMATS of Excel. The content in some cells such as ’IntNum’/’DateData’/’EmailData’,etc., represents a category of data with the same format and similar semantics. For example, ’IntNum’ represents integer type data, and ’ScientificNum’ represents scientific notation type data. ’A1:B3’ represents a region in a spreadsheet, from the first row to the third row and from column A to column B. Some cells with empty content in the spreadsheet are not entered. How many tables are there in the spreadsheet? Below is a question about one certain table in this spreadsheet. I need you to determine in which table the answer to the following question can be found, and return the RANGE of the ONE table you choose, LIKE [’range’: ’A1:F9’]. DON’T ADD OTHER WORDS OR EXPLANATION.</span>
<span id="A12.SS3.p3.1.4" class="ltx_p">INPUT:</span>
<span id="A12.SS3.p3.1.5" class="ltx_p">[Encoded Spreadsheet with compression]</span>
</span>
<span id="A12.SS3.p3.2" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS3.p3.2.1" class="ltx_p"><span id="A12.SS3.p3.2.1.1" class="ltx_text ltx_font_bold">Stage 2:</span></span>
<span id="A12.SS3.p3.2.2" class="ltx_p">INSTRUCTION:</span>
<span id="A12.SS3.p3.2.3" class="ltx_p">Given an input that is a string denoting data of cells in a table and a question about this table. The answer to the question can be found in the table. The input table includes many pairs,</span>
</span>
<span id="A12.SS3.p3.3" class="ltx_inline-block ltx_framed ltx_framed_rectangle" style="border-color: #000000;">
<span id="A12.SS3.p3.3.1" class="ltx_p">and each pair consists of a cell address and the text in that cell with a ’,’ in between, like ’A1,Year’. Cells are separated by ’|’ like ’A1,Year|A2,Profit’. The text can be empty so the cell data is like ’A1, |A2,Profit’. The cells are organized in row-major order. The answer to the input question is contained in the input table and can be represented by cell address. I need you to find the cell address of the answer in the given table based on the given question description, and return the cell ADDRESS of the answer like ’[B3]’ or ’[SUM(A2:A10)]’. DON’T ADD ANY OTHER WORDS."</span>
<span id="A12.SS3.p3.3.2" class="ltx_p">INPUT:</span>
<span id="A12.SS3.p3.3.3" class="ltx_p">[Encoded Spreadsheet without compression]</span>
</span>
</div>
<div class="ltx_pagination ltx_role_newpage"></div>
</section>
</section>
<section id="A13" class="ltx_appendix">
<h2 class="ltx_title ltx_title_appendix">
<span class="ltx_tag ltx_tag_appendix">Appendix M </span>Algorithm Steps</h2>

<section id="A13.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">M.1 </span>Identical Cell Aggregation</h3>

<div id="A13.SS1.p1" class="ltx_para">
<p id="A13.SS1.p1.1" class="ltx_p">The corresponding algorithm steps is shown in Algorithm <a href="#algorithm1" title="In M.1 Identical Cell Aggregation ‣ Appendix M Algorithm Steps ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">1</span></a>.</p>
</div>
<figure id="algorithm1" class="ltx_float ltx_algorithm">
<div id="algorithm1.26" class="ltx_listing ltx_lst_numbers_left ltx_listing">
<div id="algorithm1.1.1" class="ltx_listingline">



<span id="algorithm1.1.1.1" class="ltx_text ltx_font_bold">Input :</span> Matrix <math id="algorithm1.1.1.m1.1" class="ltx_Math" alttext="nfs" display="inline"><semantics id="algorithm1.1.1.m1.1a"><mrow id="algorithm1.1.1.m1.1.1" xref="algorithm1.1.1.m1.1.1.cmml"><mi id="algorithm1.1.1.m1.1.1.2" xref="algorithm1.1.1.m1.1.1.2.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.1.1.m1.1.1.1" xref="algorithm1.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm1.1.1.m1.1.1.3" xref="algorithm1.1.1.m1.1.1.3.cmml">f</mi><mo lspace="0em" rspace="0em" id="algorithm1.1.1.m1.1.1.1a" xref="algorithm1.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm1.1.1.m1.1.1.4" xref="algorithm1.1.1.m1.1.1.4.cmml">s</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.1.1.m1.1b"><apply id="algorithm1.1.1.m1.1.1.cmml" xref="algorithm1.1.1.m1.1.1"><times id="algorithm1.1.1.m1.1.1.1.cmml" xref="algorithm1.1.1.m1.1.1.1"></times><ci id="algorithm1.1.1.m1.1.1.2.cmml" xref="algorithm1.1.1.m1.1.1.2">𝑛</ci><ci id="algorithm1.1.1.m1.1.1.3.cmml" xref="algorithm1.1.1.m1.1.1.3">𝑓</ci><ci id="algorithm1.1.1.m1.1.1.4.cmml" xref="algorithm1.1.1.m1.1.1.4">𝑠</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.1.1.m1.1c">nfs</annotation></semantics></math> composed of all cell values in the spreadsheet. 
</div>
<div id="algorithm1.26.27" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">1</span>

</div>
<div id="algorithm1.4.4" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">2</span>Initialize <math id="algorithm1.2.2.m1.1" class="ltx_Math" alttext="m" display="inline"><semantics id="algorithm1.2.2.m1.1a"><mi id="algorithm1.2.2.m1.1.1" xref="algorithm1.2.2.m1.1.1.cmml">m</mi><annotation-xml encoding="MathML-Content" id="algorithm1.2.2.m1.1b"><ci id="algorithm1.2.2.m1.1.1.cmml" xref="algorithm1.2.2.m1.1.1">𝑚</ci></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.2.2.m1.1c">m</annotation></semantics></math> and <math id="algorithm1.3.3.m2.1" class="ltx_Math" alttext="n" display="inline"><semantics id="algorithm1.3.3.m2.1a"><mi id="algorithm1.3.3.m2.1.1" xref="algorithm1.3.3.m2.1.1.cmml">n</mi><annotation-xml encoding="MathML-Content" id="algorithm1.3.3.m2.1b"><ci id="algorithm1.3.3.m2.1.1.cmml" xref="algorithm1.3.3.m2.1.1">𝑛</ci></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.3.3.m2.1c">n</annotation></semantics></math> as the number of matrix <math id="algorithm1.4.4.m3.1" class="ltx_Math" alttext="input" display="inline"><semantics id="algorithm1.4.4.m3.1a"><mrow id="algorithm1.4.4.m3.1.1" xref="algorithm1.4.4.m3.1.1.cmml"><mi id="algorithm1.4.4.m3.1.1.2" xref="algorithm1.4.4.m3.1.1.2.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.4.4.m3.1.1.1" xref="algorithm1.4.4.m3.1.1.1.cmml">​</mo><mi id="algorithm1.4.4.m3.1.1.3" xref="algorithm1.4.4.m3.1.1.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.4.4.m3.1.1.1a" xref="algorithm1.4.4.m3.1.1.1.cmml">​</mo><mi id="algorithm1.4.4.m3.1.1.4" xref="algorithm1.4.4.m3.1.1.4.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm1.4.4.m3.1.1.1b" xref="algorithm1.4.4.m3.1.1.1.cmml">​</mo><mi id="algorithm1.4.4.m3.1.1.5" xref="algorithm1.4.4.m3.1.1.5.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.4.4.m3.1.1.1c" xref="algorithm1.4.4.m3.1.1.1.cmml">​</mo><mi id="algorithm1.4.4.m3.1.1.6" xref="algorithm1.4.4.m3.1.1.6.cmml">t</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.4.4.m3.1b"><apply id="algorithm1.4.4.m3.1.1.cmml" xref="algorithm1.4.4.m3.1.1"><times id="algorithm1.4.4.m3.1.1.1.cmml" xref="algorithm1.4.4.m3.1.1.1"></times><ci id="algorithm1.4.4.m3.1.1.2.cmml" xref="algorithm1.4.4.m3.1.1.2">𝑖</ci><ci id="algorithm1.4.4.m3.1.1.3.cmml" xref="algorithm1.4.4.m3.1.1.3">𝑛</ci><ci id="algorithm1.4.4.m3.1.1.4.cmml" xref="algorithm1.4.4.m3.1.1.4">𝑝</ci><ci id="algorithm1.4.4.m3.1.1.5.cmml" xref="algorithm1.4.4.m3.1.1.5">𝑢</ci><ci id="algorithm1.4.4.m3.1.1.6.cmml" xref="algorithm1.4.4.m3.1.1.6">𝑡</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.4.4.m3.1c">input</annotation></semantics></math> rows and columns.

</div>
<div id="algorithm1.7.7" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">3</span>Initialize the <math id="algorithm1.5.5.m1.1" class="ltx_Math" alttext="m\times n" display="inline"><semantics id="algorithm1.5.5.m1.1a"><mrow id="algorithm1.5.5.m1.1.1" xref="algorithm1.5.5.m1.1.1.cmml"><mi id="algorithm1.5.5.m1.1.1.2" xref="algorithm1.5.5.m1.1.1.2.cmml">m</mi><mo lspace="0.222em" rspace="0.222em" id="algorithm1.5.5.m1.1.1.1" xref="algorithm1.5.5.m1.1.1.1.cmml">×</mo><mi id="algorithm1.5.5.m1.1.1.3" xref="algorithm1.5.5.m1.1.1.3.cmml">n</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.5.5.m1.1b"><apply id="algorithm1.5.5.m1.1.1.cmml" xref="algorithm1.5.5.m1.1.1"><times id="algorithm1.5.5.m1.1.1.1.cmml" xref="algorithm1.5.5.m1.1.1.1"></times><ci id="algorithm1.5.5.m1.1.1.2.cmml" xref="algorithm1.5.5.m1.1.1.2">𝑚</ci><ci id="algorithm1.5.5.m1.1.1.3.cmml" xref="algorithm1.5.5.m1.1.1.3">𝑛</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.5.5.m1.1c">m\times n</annotation></semantics></math> matrix <math id="algorithm1.6.6.m2.1" class="ltx_Math" alttext="visited" display="inline"><semantics id="algorithm1.6.6.m2.1a"><mrow id="algorithm1.6.6.m2.1.1" xref="algorithm1.6.6.m2.1.1.cmml"><mi id="algorithm1.6.6.m2.1.1.2" xref="algorithm1.6.6.m2.1.1.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.3" xref="algorithm1.6.6.m2.1.1.3.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1a" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.4" xref="algorithm1.6.6.m2.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1b" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.5" xref="algorithm1.6.6.m2.1.1.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1c" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.6" xref="algorithm1.6.6.m2.1.1.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1d" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.7" xref="algorithm1.6.6.m2.1.1.7.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.6.6.m2.1.1.1e" xref="algorithm1.6.6.m2.1.1.1.cmml">​</mo><mi id="algorithm1.6.6.m2.1.1.8" xref="algorithm1.6.6.m2.1.1.8.cmml">d</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.6.6.m2.1b"><apply id="algorithm1.6.6.m2.1.1.cmml" xref="algorithm1.6.6.m2.1.1"><times id="algorithm1.6.6.m2.1.1.1.cmml" xref="algorithm1.6.6.m2.1.1.1"></times><ci id="algorithm1.6.6.m2.1.1.2.cmml" xref="algorithm1.6.6.m2.1.1.2">𝑣</ci><ci id="algorithm1.6.6.m2.1.1.3.cmml" xref="algorithm1.6.6.m2.1.1.3">𝑖</ci><ci id="algorithm1.6.6.m2.1.1.4.cmml" xref="algorithm1.6.6.m2.1.1.4">𝑠</ci><ci id="algorithm1.6.6.m2.1.1.5.cmml" xref="algorithm1.6.6.m2.1.1.5">𝑖</ci><ci id="algorithm1.6.6.m2.1.1.6.cmml" xref="algorithm1.6.6.m2.1.1.6">𝑡</ci><ci id="algorithm1.6.6.m2.1.1.7.cmml" xref="algorithm1.6.6.m2.1.1.7">𝑒</ci><ci id="algorithm1.6.6.m2.1.1.8.cmml" xref="algorithm1.6.6.m2.1.1.8">𝑑</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.6.6.m2.1c">visited</annotation></semantics></math> with all values set to <math id="algorithm1.7.7.m3.1" class="ltx_Math" alttext="False" display="inline"><semantics id="algorithm1.7.7.m3.1a"><mrow id="algorithm1.7.7.m3.1.1" xref="algorithm1.7.7.m3.1.1.cmml"><mi id="algorithm1.7.7.m3.1.1.2" xref="algorithm1.7.7.m3.1.1.2.cmml">F</mi><mo lspace="0em" rspace="0em" id="algorithm1.7.7.m3.1.1.1" xref="algorithm1.7.7.m3.1.1.1.cmml">​</mo><mi id="algorithm1.7.7.m3.1.1.3" xref="algorithm1.7.7.m3.1.1.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.7.7.m3.1.1.1a" xref="algorithm1.7.7.m3.1.1.1.cmml">​</mo><mi id="algorithm1.7.7.m3.1.1.4" xref="algorithm1.7.7.m3.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm1.7.7.m3.1.1.1b" xref="algorithm1.7.7.m3.1.1.1.cmml">​</mo><mi id="algorithm1.7.7.m3.1.1.5" xref="algorithm1.7.7.m3.1.1.5.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.7.7.m3.1.1.1c" xref="algorithm1.7.7.m3.1.1.1.cmml">​</mo><mi id="algorithm1.7.7.m3.1.1.6" xref="algorithm1.7.7.m3.1.1.6.cmml">e</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.7.7.m3.1b"><apply id="algorithm1.7.7.m3.1.1.cmml" xref="algorithm1.7.7.m3.1.1"><times id="algorithm1.7.7.m3.1.1.1.cmml" xref="algorithm1.7.7.m3.1.1.1"></times><ci id="algorithm1.7.7.m3.1.1.2.cmml" xref="algorithm1.7.7.m3.1.1.2">𝐹</ci><ci id="algorithm1.7.7.m3.1.1.3.cmml" xref="algorithm1.7.7.m3.1.1.3">𝑎</ci><ci id="algorithm1.7.7.m3.1.1.4.cmml" xref="algorithm1.7.7.m3.1.1.4">𝑙</ci><ci id="algorithm1.7.7.m3.1.1.5.cmml" xref="algorithm1.7.7.m3.1.1.5">𝑠</ci><ci id="algorithm1.7.7.m3.1.1.6.cmml" xref="algorithm1.7.7.m3.1.1.6">𝑒</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.7.7.m3.1c">False</annotation></semantics></math>.

</div>
<div id="algorithm1.8.8" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">4</span>Initialize <math id="algorithm1.8.8.m1.1" class="ltx_Math" alttext="areas" display="inline"><semantics id="algorithm1.8.8.m1.1a"><mrow id="algorithm1.8.8.m1.1.1" xref="algorithm1.8.8.m1.1.1.cmml"><mi id="algorithm1.8.8.m1.1.1.2" xref="algorithm1.8.8.m1.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.8.8.m1.1.1.1" xref="algorithm1.8.8.m1.1.1.1.cmml">​</mo><mi id="algorithm1.8.8.m1.1.1.3" xref="algorithm1.8.8.m1.1.1.3.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm1.8.8.m1.1.1.1a" xref="algorithm1.8.8.m1.1.1.1.cmml">​</mo><mi id="algorithm1.8.8.m1.1.1.4" xref="algorithm1.8.8.m1.1.1.4.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.8.8.m1.1.1.1b" xref="algorithm1.8.8.m1.1.1.1.cmml">​</mo><mi id="algorithm1.8.8.m1.1.1.5" xref="algorithm1.8.8.m1.1.1.5.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.8.8.m1.1.1.1c" xref="algorithm1.8.8.m1.1.1.1.cmml">​</mo><mi id="algorithm1.8.8.m1.1.1.6" xref="algorithm1.8.8.m1.1.1.6.cmml">s</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.8.8.m1.1b"><apply id="algorithm1.8.8.m1.1.1.cmml" xref="algorithm1.8.8.m1.1.1"><times id="algorithm1.8.8.m1.1.1.1.cmml" xref="algorithm1.8.8.m1.1.1.1"></times><ci id="algorithm1.8.8.m1.1.1.2.cmml" xref="algorithm1.8.8.m1.1.1.2">𝑎</ci><ci id="algorithm1.8.8.m1.1.1.3.cmml" xref="algorithm1.8.8.m1.1.1.3">𝑟</ci><ci id="algorithm1.8.8.m1.1.1.4.cmml" xref="algorithm1.8.8.m1.1.1.4">𝑒</ci><ci id="algorithm1.8.8.m1.1.1.5.cmml" xref="algorithm1.8.8.m1.1.1.5">𝑎</ci><ci id="algorithm1.8.8.m1.1.1.6.cmml" xref="algorithm1.8.8.m1.1.1.6">𝑠</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.8.8.m1.1c">areas</annotation></semantics></math> as an empty list.

</div>
<div id="algorithm1.9.9" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">5</span>Initialize the <math id="algorithm1.9.9.m1.1" class="ltx_Math" alttext="FormatDict" display="inline"><semantics id="algorithm1.9.9.m1.1a"><mrow id="algorithm1.9.9.m1.1.1" xref="algorithm1.9.9.m1.1.1.cmml"><mi id="algorithm1.9.9.m1.1.1.2" xref="algorithm1.9.9.m1.1.1.2.cmml">F</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.3" xref="algorithm1.9.9.m1.1.1.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1a" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.4" xref="algorithm1.9.9.m1.1.1.4.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1b" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.5" xref="algorithm1.9.9.m1.1.1.5.cmml">m</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1c" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.6" xref="algorithm1.9.9.m1.1.1.6.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1d" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.7" xref="algorithm1.9.9.m1.1.1.7.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1e" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.8" xref="algorithm1.9.9.m1.1.1.8.cmml">D</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1f" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.9" xref="algorithm1.9.9.m1.1.1.9.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1g" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.10" xref="algorithm1.9.9.m1.1.1.10.cmml">c</mi><mo lspace="0em" rspace="0em" id="algorithm1.9.9.m1.1.1.1h" xref="algorithm1.9.9.m1.1.1.1.cmml">​</mo><mi id="algorithm1.9.9.m1.1.1.11" xref="algorithm1.9.9.m1.1.1.11.cmml">t</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.9.9.m1.1b"><apply id="algorithm1.9.9.m1.1.1.cmml" xref="algorithm1.9.9.m1.1.1"><times id="algorithm1.9.9.m1.1.1.1.cmml" xref="algorithm1.9.9.m1.1.1.1"></times><ci id="algorithm1.9.9.m1.1.1.2.cmml" xref="algorithm1.9.9.m1.1.1.2">𝐹</ci><ci id="algorithm1.9.9.m1.1.1.3.cmml" xref="algorithm1.9.9.m1.1.1.3">𝑜</ci><ci id="algorithm1.9.9.m1.1.1.4.cmml" xref="algorithm1.9.9.m1.1.1.4">𝑟</ci><ci id="algorithm1.9.9.m1.1.1.5.cmml" xref="algorithm1.9.9.m1.1.1.5">𝑚</ci><ci id="algorithm1.9.9.m1.1.1.6.cmml" xref="algorithm1.9.9.m1.1.1.6">𝑎</ci><ci id="algorithm1.9.9.m1.1.1.7.cmml" xref="algorithm1.9.9.m1.1.1.7">𝑡</ci><ci id="algorithm1.9.9.m1.1.1.8.cmml" xref="algorithm1.9.9.m1.1.1.8">𝐷</ci><ci id="algorithm1.9.9.m1.1.1.9.cmml" xref="algorithm1.9.9.m1.1.1.9">𝑖</ci><ci id="algorithm1.9.9.m1.1.1.10.cmml" xref="algorithm1.9.9.m1.1.1.10">𝑐</ci><ci id="algorithm1.9.9.m1.1.1.11.cmml" xref="algorithm1.9.9.m1.1.1.11">𝑡</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.9.9.m1.1c">FormatDict</annotation></semantics></math> dictionary, the key-value pairs are data values and predefined types respectively.

</div>
<div id="algorithm1.26.28" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">6</span>

<span id="algorithm1.26.28.1" class="ltx_text ltx_font_bold">Function</span> <em id="algorithm1.26.28.2" class="ltx_emph ltx_font_typewriter">dfs(<em id="algorithm1.26.28.2.1" class="ltx_emph ltx_font_serif ltx_font_italic">r, c, val_type</em>)</em><span id="algorithm1.26.28.3" class="ltx_text ltx_font_bold">:</span>
</div>
<div id="algorithm1.10.10" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">7</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.10.10.2" class="ltx_text ltx_font_bold">if</span> <em id="algorithm1.10.10.1" class="ltx_emph ltx_font_italic"> <math id="algorithm1.10.10.1.m1.2" class="ltx_math_unparsed" alttext="visited[r][c])\lor val\_type!=\text{FormatDict}[nfs[r,c]]" display="inline"><semantics id="algorithm1.10.10.1.m1.2a"><mrow id="algorithm1.10.10.1.m1.2b"><mi id="algorithm1.10.10.1.m1.2.3">v</mi><mi id="algorithm1.10.10.1.m1.2.4">i</mi><mi id="algorithm1.10.10.1.m1.2.5">s</mi><mi id="algorithm1.10.10.1.m1.2.6">i</mi><mi id="algorithm1.10.10.1.m1.2.7">t</mi><mi id="algorithm1.10.10.1.m1.2.8">e</mi><mi id="algorithm1.10.10.1.m1.2.9">d</mi><mrow id="algorithm1.10.10.1.m1.2.10"><mo stretchy="false" id="algorithm1.10.10.1.m1.2.10.1">[</mo><mi id="algorithm1.10.10.1.m1.1.1">r</mi><mo stretchy="false" id="algorithm1.10.10.1.m1.2.10.2">]</mo></mrow><mrow id="algorithm1.10.10.1.m1.2.11"><mo stretchy="false" id="algorithm1.10.10.1.m1.2.11.1">[</mo><mi id="algorithm1.10.10.1.m1.2.2">c</mi><mo stretchy="false" id="algorithm1.10.10.1.m1.2.11.2">]</mo></mrow><mo stretchy="false" id="algorithm1.10.10.1.m1.2.12">)</mo><mo id="algorithm1.10.10.1.m1.2.13">∨</mo><mi id="algorithm1.10.10.1.m1.2.14">v</mi><mi id="algorithm1.10.10.1.m1.2.15">a</mi><mi id="algorithm1.10.10.1.m1.2.16">l</mi><mi mathvariant="normal" id="algorithm1.10.10.1.m1.2.17">_</mi><mi id="algorithm1.10.10.1.m1.2.18">t</mi><mi id="algorithm1.10.10.1.m1.2.19">y</mi><mi id="algorithm1.10.10.1.m1.2.20">p</mi><mi id="algorithm1.10.10.1.m1.2.21">e</mi><mo id="algorithm1.10.10.1.m1.2.22">!</mo><mo id="algorithm1.10.10.1.m1.2.23">=</mo><mtext class="ltx_mathvariant_italic" id="algorithm1.10.10.1.m1.2.24">FormatDict</mtext><mo stretchy="false" id="algorithm1.10.10.1.m1.2.25">[</mo><mi id="algorithm1.10.10.1.m1.2.26">n</mi><mi id="algorithm1.10.10.1.m1.2.27">f</mi><mi id="algorithm1.10.10.1.m1.2.28">s</mi><mrow id="algorithm1.10.10.1.m1.2.29"><mo stretchy="false" id="algorithm1.10.10.1.m1.2.29.1">[</mo><mi id="algorithm1.10.10.1.m1.2.29.2">r</mi><mo id="algorithm1.10.10.1.m1.2.29.3">,</mo><mi id="algorithm1.10.10.1.m1.2.29.4">c</mi><mo stretchy="false" id="algorithm1.10.10.1.m1.2.29.5">]</mo></mrow><mo stretchy="false" id="algorithm1.10.10.1.m1.2.30">]</mo></mrow><annotation encoding="application/x-tex" id="algorithm1.10.10.1.m1.2c">visited[r][c])\lor val\_type!=\text{FormatDict}[nfs[r,c]]</annotation></semantics></math></em> <span id="algorithm1.10.10.3" class="ltx_text ltx_font_bold">then</span>
</div>
<div id="algorithm1.11.11" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">8</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.11.11.1" class="ltx_text ltx_font_bold">return</span> <math id="algorithm1.11.11.m1.4" class="ltx_Math" alttext="[r,c,r-1,c-1]" display="inline"><semantics id="algorithm1.11.11.m1.4a"><mrow id="algorithm1.11.11.m1.4.4.2" xref="algorithm1.11.11.m1.4.4.3.cmml"><mo stretchy="false" id="algorithm1.11.11.m1.4.4.2.3" xref="algorithm1.11.11.m1.4.4.3.cmml">[</mo><mi id="algorithm1.11.11.m1.1.1" xref="algorithm1.11.11.m1.1.1.cmml">r</mi><mo id="algorithm1.11.11.m1.4.4.2.4" xref="algorithm1.11.11.m1.4.4.3.cmml">,</mo><mi id="algorithm1.11.11.m1.2.2" xref="algorithm1.11.11.m1.2.2.cmml">c</mi><mo id="algorithm1.11.11.m1.4.4.2.5" xref="algorithm1.11.11.m1.4.4.3.cmml">,</mo><mrow id="algorithm1.11.11.m1.3.3.1.1" xref="algorithm1.11.11.m1.3.3.1.1.cmml"><mi id="algorithm1.11.11.m1.3.3.1.1.2" xref="algorithm1.11.11.m1.3.3.1.1.2.cmml">r</mi><mo id="algorithm1.11.11.m1.3.3.1.1.1" xref="algorithm1.11.11.m1.3.3.1.1.1.cmml">−</mo><mn id="algorithm1.11.11.m1.3.3.1.1.3" xref="algorithm1.11.11.m1.3.3.1.1.3.cmml">1</mn></mrow><mo id="algorithm1.11.11.m1.4.4.2.6" xref="algorithm1.11.11.m1.4.4.3.cmml">,</mo><mrow id="algorithm1.11.11.m1.4.4.2.2" xref="algorithm1.11.11.m1.4.4.2.2.cmml"><mi id="algorithm1.11.11.m1.4.4.2.2.2" xref="algorithm1.11.11.m1.4.4.2.2.2.cmml">c</mi><mo id="algorithm1.11.11.m1.4.4.2.2.1" xref="algorithm1.11.11.m1.4.4.2.2.1.cmml">−</mo><mn id="algorithm1.11.11.m1.4.4.2.2.3" xref="algorithm1.11.11.m1.4.4.2.2.3.cmml">1</mn></mrow><mo stretchy="false" id="algorithm1.11.11.m1.4.4.2.7" xref="algorithm1.11.11.m1.4.4.3.cmml">]</mo></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.11.11.m1.4b"><list id="algorithm1.11.11.m1.4.4.3.cmml" xref="algorithm1.11.11.m1.4.4.2"><ci id="algorithm1.11.11.m1.1.1.cmml" xref="algorithm1.11.11.m1.1.1">𝑟</ci><ci id="algorithm1.11.11.m1.2.2.cmml" xref="algorithm1.11.11.m1.2.2">𝑐</ci><apply id="algorithm1.11.11.m1.3.3.1.1.cmml" xref="algorithm1.11.11.m1.3.3.1.1"><minus id="algorithm1.11.11.m1.3.3.1.1.1.cmml" xref="algorithm1.11.11.m1.3.3.1.1.1"></minus><ci id="algorithm1.11.11.m1.3.3.1.1.2.cmml" xref="algorithm1.11.11.m1.3.3.1.1.2">𝑟</ci><cn type="integer" id="algorithm1.11.11.m1.3.3.1.1.3.cmml" xref="algorithm1.11.11.m1.3.3.1.1.3">1</cn></apply><apply id="algorithm1.11.11.m1.4.4.2.2.cmml" xref="algorithm1.11.11.m1.4.4.2.2"><minus id="algorithm1.11.11.m1.4.4.2.2.1.cmml" xref="algorithm1.11.11.m1.4.4.2.2.1"></minus><ci id="algorithm1.11.11.m1.4.4.2.2.2.cmml" xref="algorithm1.11.11.m1.4.4.2.2.2">𝑐</ci><cn type="integer" id="algorithm1.11.11.m1.4.4.2.2.3.cmml" xref="algorithm1.11.11.m1.4.4.2.2.3">1</cn></apply></list></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.11.11.m1.4c">[r,c,r-1,c-1]</annotation></semantics></math>;
</div>
<div id="algorithm1.26.29" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">9</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm1.12.12" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">10</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   <math id="algorithm1.12.12.m1.2" class="ltx_Math" alttext="visited[r][c]\leftarrow\text{True}" display="inline"><semantics id="algorithm1.12.12.m1.2a"><mrow id="algorithm1.12.12.m1.2.3" xref="algorithm1.12.12.m1.2.3.cmml"><mrow id="algorithm1.12.12.m1.2.3.2" xref="algorithm1.12.12.m1.2.3.2.cmml"><mi id="algorithm1.12.12.m1.2.3.2.2" xref="algorithm1.12.12.m1.2.3.2.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.3" xref="algorithm1.12.12.m1.2.3.2.3.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1a" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.4" xref="algorithm1.12.12.m1.2.3.2.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1b" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.5" xref="algorithm1.12.12.m1.2.3.2.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1c" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.6" xref="algorithm1.12.12.m1.2.3.2.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1d" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.7" xref="algorithm1.12.12.m1.2.3.2.7.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1e" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.12.12.m1.2.3.2.8" xref="algorithm1.12.12.m1.2.3.2.8.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1f" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mrow id="algorithm1.12.12.m1.2.3.2.9.2" xref="algorithm1.12.12.m1.2.3.2.9.1.cmml"><mo stretchy="false" id="algorithm1.12.12.m1.2.3.2.9.2.1" xref="algorithm1.12.12.m1.2.3.2.9.1.1.cmml">[</mo><mi id="algorithm1.12.12.m1.1.1" xref="algorithm1.12.12.m1.1.1.cmml">r</mi><mo stretchy="false" id="algorithm1.12.12.m1.2.3.2.9.2.2" xref="algorithm1.12.12.m1.2.3.2.9.1.1.cmml">]</mo></mrow><mo lspace="0em" rspace="0em" id="algorithm1.12.12.m1.2.3.2.1g" xref="algorithm1.12.12.m1.2.3.2.1.cmml">​</mo><mrow id="algorithm1.12.12.m1.2.3.2.10.2" xref="algorithm1.12.12.m1.2.3.2.10.1.cmml"><mo stretchy="false" id="algorithm1.12.12.m1.2.3.2.10.2.1" xref="algorithm1.12.12.m1.2.3.2.10.1.1.cmml">[</mo><mi id="algorithm1.12.12.m1.2.2" xref="algorithm1.12.12.m1.2.2.cmml">c</mi><mo stretchy="false" id="algorithm1.12.12.m1.2.3.2.10.2.2" xref="algorithm1.12.12.m1.2.3.2.10.1.1.cmml">]</mo></mrow></mrow><mo stretchy="false" id="algorithm1.12.12.m1.2.3.1" xref="algorithm1.12.12.m1.2.3.1.cmml">←</mo><mtext id="algorithm1.12.12.m1.2.3.3" xref="algorithm1.12.12.m1.2.3.3a.cmml">True</mtext></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.12.12.m1.2b"><apply id="algorithm1.12.12.m1.2.3.cmml" xref="algorithm1.12.12.m1.2.3"><ci id="algorithm1.12.12.m1.2.3.1.cmml" xref="algorithm1.12.12.m1.2.3.1">←</ci><apply id="algorithm1.12.12.m1.2.3.2.cmml" xref="algorithm1.12.12.m1.2.3.2"><times id="algorithm1.12.12.m1.2.3.2.1.cmml" xref="algorithm1.12.12.m1.2.3.2.1"></times><ci id="algorithm1.12.12.m1.2.3.2.2.cmml" xref="algorithm1.12.12.m1.2.3.2.2">𝑣</ci><ci id="algorithm1.12.12.m1.2.3.2.3.cmml" xref="algorithm1.12.12.m1.2.3.2.3">𝑖</ci><ci id="algorithm1.12.12.m1.2.3.2.4.cmml" xref="algorithm1.12.12.m1.2.3.2.4">𝑠</ci><ci id="algorithm1.12.12.m1.2.3.2.5.cmml" xref="algorithm1.12.12.m1.2.3.2.5">𝑖</ci><ci id="algorithm1.12.12.m1.2.3.2.6.cmml" xref="algorithm1.12.12.m1.2.3.2.6">𝑡</ci><ci id="algorithm1.12.12.m1.2.3.2.7.cmml" xref="algorithm1.12.12.m1.2.3.2.7">𝑒</ci><ci id="algorithm1.12.12.m1.2.3.2.8.cmml" xref="algorithm1.12.12.m1.2.3.2.8">𝑑</ci><apply id="algorithm1.12.12.m1.2.3.2.9.1.cmml" xref="algorithm1.12.12.m1.2.3.2.9.2"><csymbol cd="latexml" id="algorithm1.12.12.m1.2.3.2.9.1.1.cmml" xref="algorithm1.12.12.m1.2.3.2.9.2.1">delimited-[]</csymbol><ci id="algorithm1.12.12.m1.1.1.cmml" xref="algorithm1.12.12.m1.1.1">𝑟</ci></apply><apply id="algorithm1.12.12.m1.2.3.2.10.1.cmml" xref="algorithm1.12.12.m1.2.3.2.10.2"><csymbol cd="latexml" id="algorithm1.12.12.m1.2.3.2.10.1.1.cmml" xref="algorithm1.12.12.m1.2.3.2.10.2.1">delimited-[]</csymbol><ci id="algorithm1.12.12.m1.2.2.cmml" xref="algorithm1.12.12.m1.2.2">𝑐</ci></apply></apply><ci id="algorithm1.12.12.m1.2.3.3a.cmml" xref="algorithm1.12.12.m1.2.3.3"><mtext id="algorithm1.12.12.m1.2.3.3.cmml" xref="algorithm1.12.12.m1.2.3.3">True</mtext></ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.12.12.m1.2c">visited[r][c]\leftarrow\text{True}</annotation></semantics></math>;
</div>
<div id="algorithm1.13.13" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">11</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm1.13.13.m1.4" class="ltx_Math" alttext="bounds\leftarrow[r,c,r,c]" display="inline"><semantics id="algorithm1.13.13.m1.4a"><mrow id="algorithm1.13.13.m1.4.5" xref="algorithm1.13.13.m1.4.5.cmml"><mrow id="algorithm1.13.13.m1.4.5.2" xref="algorithm1.13.13.m1.4.5.2.cmml"><mi id="algorithm1.13.13.m1.4.5.2.2" xref="algorithm1.13.13.m1.4.5.2.2.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm1.13.13.m1.4.5.2.1" xref="algorithm1.13.13.m1.4.5.2.1.cmml">​</mo><mi id="algorithm1.13.13.m1.4.5.2.3" xref="algorithm1.13.13.m1.4.5.2.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.13.13.m1.4.5.2.1a" xref="algorithm1.13.13.m1.4.5.2.1.cmml">​</mo><mi id="algorithm1.13.13.m1.4.5.2.4" xref="algorithm1.13.13.m1.4.5.2.4.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.13.13.m1.4.5.2.1b" xref="algorithm1.13.13.m1.4.5.2.1.cmml">​</mo><mi id="algorithm1.13.13.m1.4.5.2.5" xref="algorithm1.13.13.m1.4.5.2.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.13.13.m1.4.5.2.1c" xref="algorithm1.13.13.m1.4.5.2.1.cmml">​</mo><mi id="algorithm1.13.13.m1.4.5.2.6" xref="algorithm1.13.13.m1.4.5.2.6.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.13.13.m1.4.5.2.1d" xref="algorithm1.13.13.m1.4.5.2.1.cmml">​</mo><mi id="algorithm1.13.13.m1.4.5.2.7" xref="algorithm1.13.13.m1.4.5.2.7.cmml">s</mi></mrow><mo stretchy="false" id="algorithm1.13.13.m1.4.5.1" xref="algorithm1.13.13.m1.4.5.1.cmml">←</mo><mrow id="algorithm1.13.13.m1.4.5.3.2" xref="algorithm1.13.13.m1.4.5.3.1.cmml"><mo stretchy="false" id="algorithm1.13.13.m1.4.5.3.2.1" xref="algorithm1.13.13.m1.4.5.3.1.cmml">[</mo><mi id="algorithm1.13.13.m1.1.1" xref="algorithm1.13.13.m1.1.1.cmml">r</mi><mo id="algorithm1.13.13.m1.4.5.3.2.2" xref="algorithm1.13.13.m1.4.5.3.1.cmml">,</mo><mi id="algorithm1.13.13.m1.2.2" xref="algorithm1.13.13.m1.2.2.cmml">c</mi><mo id="algorithm1.13.13.m1.4.5.3.2.3" xref="algorithm1.13.13.m1.4.5.3.1.cmml">,</mo><mi id="algorithm1.13.13.m1.3.3" xref="algorithm1.13.13.m1.3.3.cmml">r</mi><mo id="algorithm1.13.13.m1.4.5.3.2.4" xref="algorithm1.13.13.m1.4.5.3.1.cmml">,</mo><mi id="algorithm1.13.13.m1.4.4" xref="algorithm1.13.13.m1.4.4.cmml">c</mi><mo stretchy="false" id="algorithm1.13.13.m1.4.5.3.2.5" xref="algorithm1.13.13.m1.4.5.3.1.cmml">]</mo></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.13.13.m1.4b"><apply id="algorithm1.13.13.m1.4.5.cmml" xref="algorithm1.13.13.m1.4.5"><ci id="algorithm1.13.13.m1.4.5.1.cmml" xref="algorithm1.13.13.m1.4.5.1">←</ci><apply id="algorithm1.13.13.m1.4.5.2.cmml" xref="algorithm1.13.13.m1.4.5.2"><times id="algorithm1.13.13.m1.4.5.2.1.cmml" xref="algorithm1.13.13.m1.4.5.2.1"></times><ci id="algorithm1.13.13.m1.4.5.2.2.cmml" xref="algorithm1.13.13.m1.4.5.2.2">𝑏</ci><ci id="algorithm1.13.13.m1.4.5.2.3.cmml" xref="algorithm1.13.13.m1.4.5.2.3">𝑜</ci><ci id="algorithm1.13.13.m1.4.5.2.4.cmml" xref="algorithm1.13.13.m1.4.5.2.4">𝑢</ci><ci id="algorithm1.13.13.m1.4.5.2.5.cmml" xref="algorithm1.13.13.m1.4.5.2.5">𝑛</ci><ci id="algorithm1.13.13.m1.4.5.2.6.cmml" xref="algorithm1.13.13.m1.4.5.2.6">𝑑</ci><ci id="algorithm1.13.13.m1.4.5.2.7.cmml" xref="algorithm1.13.13.m1.4.5.2.7">𝑠</ci></apply><list id="algorithm1.13.13.m1.4.5.3.1.cmml" xref="algorithm1.13.13.m1.4.5.3.2"><ci id="algorithm1.13.13.m1.1.1.cmml" xref="algorithm1.13.13.m1.1.1">𝑟</ci><ci id="algorithm1.13.13.m1.2.2.cmml" xref="algorithm1.13.13.m1.2.2">𝑐</ci><ci id="algorithm1.13.13.m1.3.3.cmml" xref="algorithm1.13.13.m1.3.3">𝑟</ci><ci id="algorithm1.13.13.m1.4.4.cmml" xref="algorithm1.13.13.m1.4.4">𝑐</ci></list></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.13.13.m1.4c">bounds\leftarrow[r,c,r,c]</annotation></semantics></math>;
</div>
<div id="algorithm1.26.30" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">12</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.26.30.1" class="ltx_text ltx_font_bold">foreach</span> <em id="algorithm1.26.30.2" class="ltx_emph ltx_font_italic">(tr, tc) around (r, c)</em> <span id="algorithm1.26.30.3" class="ltx_text ltx_font_bold">do</span>
</div>
<div id="algorithm1.14.14" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">13</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.14.14.2" class="ltx_text ltx_font_bold">if</span> <em id="algorithm1.14.14.1" class="ltx_emph ltx_font_italic"> <math id="algorithm1.14.14.1.m1.1" class="ltx_math_unparsed" alttext="\neg visited[tr][tc])\land val\_type==\text{FormatDict}[nfs[tr,tc]]" display="inline"><semantics id="algorithm1.14.14.1.m1.1a"><mrow id="algorithm1.14.14.1.m1.1b"><mo rspace="0.167em" id="algorithm1.14.14.1.m1.1.1">¬</mo><mi id="algorithm1.14.14.1.m1.1.2">v</mi><mi id="algorithm1.14.14.1.m1.1.3">i</mi><mi id="algorithm1.14.14.1.m1.1.4">s</mi><mi id="algorithm1.14.14.1.m1.1.5">i</mi><mi id="algorithm1.14.14.1.m1.1.6">t</mi><mi id="algorithm1.14.14.1.m1.1.7">e</mi><mi id="algorithm1.14.14.1.m1.1.8">d</mi><mrow id="algorithm1.14.14.1.m1.1.9"><mo stretchy="false" id="algorithm1.14.14.1.m1.1.9.1">[</mo><mi id="algorithm1.14.14.1.m1.1.9.2">t</mi><mi id="algorithm1.14.14.1.m1.1.9.3">r</mi><mo stretchy="false" id="algorithm1.14.14.1.m1.1.9.4">]</mo></mrow><mrow id="algorithm1.14.14.1.m1.1.10"><mo stretchy="false" id="algorithm1.14.14.1.m1.1.10.1">[</mo><mi id="algorithm1.14.14.1.m1.1.10.2">t</mi><mi id="algorithm1.14.14.1.m1.1.10.3">c</mi><mo stretchy="false" id="algorithm1.14.14.1.m1.1.10.4">]</mo></mrow><mo stretchy="false" id="algorithm1.14.14.1.m1.1.11">)</mo><mo id="algorithm1.14.14.1.m1.1.12">∧</mo><mi id="algorithm1.14.14.1.m1.1.13">v</mi><mi id="algorithm1.14.14.1.m1.1.14">a</mi><mi id="algorithm1.14.14.1.m1.1.15">l</mi><mi mathvariant="normal" id="algorithm1.14.14.1.m1.1.16">_</mi><mi id="algorithm1.14.14.1.m1.1.17">t</mi><mi id="algorithm1.14.14.1.m1.1.18">y</mi><mi id="algorithm1.14.14.1.m1.1.19">p</mi><mi id="algorithm1.14.14.1.m1.1.20">e</mi><mo rspace="0em" id="algorithm1.14.14.1.m1.1.21">=</mo><mo lspace="0em" id="algorithm1.14.14.1.m1.1.22">=</mo><mtext class="ltx_mathvariant_italic" id="algorithm1.14.14.1.m1.1.23">FormatDict</mtext><mo stretchy="false" id="algorithm1.14.14.1.m1.1.24">[</mo><mi id="algorithm1.14.14.1.m1.1.25">n</mi><mi id="algorithm1.14.14.1.m1.1.26">f</mi><mi id="algorithm1.14.14.1.m1.1.27">s</mi><mrow id="algorithm1.14.14.1.m1.1.28"><mo stretchy="false" id="algorithm1.14.14.1.m1.1.28.1">[</mo><mi id="algorithm1.14.14.1.m1.1.28.2">t</mi><mi id="algorithm1.14.14.1.m1.1.28.3">r</mi><mo id="algorithm1.14.14.1.m1.1.28.4">,</mo><mi id="algorithm1.14.14.1.m1.1.28.5">t</mi><mi id="algorithm1.14.14.1.m1.1.28.6">c</mi><mo stretchy="false" id="algorithm1.14.14.1.m1.1.28.7">]</mo></mrow><mo stretchy="false" id="algorithm1.14.14.1.m1.1.29">]</mo></mrow><annotation encoding="application/x-tex" id="algorithm1.14.14.1.m1.1c">\neg visited[tr][tc])\land val\_type==\text{FormatDict}[nfs[tr,tc]]</annotation></semantics></math></em> <span id="algorithm1.14.14.3" class="ltx_text ltx_font_bold">then</span>
</div>
<div id="algorithm1.15.15" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">14</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm1.15.15.m1.3" class="ltx_Math" alttext="new\_bounds\leftarrow\text{dfs}(tr,tc,val\_type)" display="inline"><semantics id="algorithm1.15.15.m1.3a"><mrow id="algorithm1.15.15.m1.3.3" xref="algorithm1.15.15.m1.3.3.cmml"><mrow id="algorithm1.15.15.m1.3.3.5" xref="algorithm1.15.15.m1.3.3.5.cmml"><mi id="algorithm1.15.15.m1.3.3.5.2" xref="algorithm1.15.15.m1.3.3.5.2.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.3" xref="algorithm1.15.15.m1.3.3.5.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1a" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.4" xref="algorithm1.15.15.m1.3.3.5.4.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1b" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi mathvariant="normal" id="algorithm1.15.15.m1.3.3.5.5" xref="algorithm1.15.15.m1.3.3.5.5.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1c" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.6" xref="algorithm1.15.15.m1.3.3.5.6.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1d" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.7" xref="algorithm1.15.15.m1.3.3.5.7.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1e" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.8" xref="algorithm1.15.15.m1.3.3.5.8.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1f" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.9" xref="algorithm1.15.15.m1.3.3.5.9.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1g" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.10" xref="algorithm1.15.15.m1.3.3.5.10.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.5.1h" xref="algorithm1.15.15.m1.3.3.5.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.5.11" xref="algorithm1.15.15.m1.3.3.5.11.cmml">s</mi></mrow><mo stretchy="false" id="algorithm1.15.15.m1.3.3.4" xref="algorithm1.15.15.m1.3.3.4.cmml">←</mo><mrow id="algorithm1.15.15.m1.3.3.3" xref="algorithm1.15.15.m1.3.3.3.cmml"><mtext id="algorithm1.15.15.m1.3.3.3.5" xref="algorithm1.15.15.m1.3.3.3.5a.cmml">dfs</mtext><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.4" xref="algorithm1.15.15.m1.3.3.3.4.cmml">​</mo><mrow id="algorithm1.15.15.m1.3.3.3.3.3" xref="algorithm1.15.15.m1.3.3.3.3.4.cmml"><mo stretchy="false" id="algorithm1.15.15.m1.3.3.3.3.3.4" xref="algorithm1.15.15.m1.3.3.3.3.4.cmml">(</mo><mrow id="algorithm1.15.15.m1.1.1.1.1.1.1" xref="algorithm1.15.15.m1.1.1.1.1.1.1.cmml"><mi id="algorithm1.15.15.m1.1.1.1.1.1.1.2" xref="algorithm1.15.15.m1.1.1.1.1.1.1.2.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.1.1.1.1.1.1.1" xref="algorithm1.15.15.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.15.15.m1.1.1.1.1.1.1.3" xref="algorithm1.15.15.m1.1.1.1.1.1.1.3.cmml">r</mi></mrow><mo id="algorithm1.15.15.m1.3.3.3.3.3.5" xref="algorithm1.15.15.m1.3.3.3.3.4.cmml">,</mo><mrow id="algorithm1.15.15.m1.2.2.2.2.2.2" xref="algorithm1.15.15.m1.2.2.2.2.2.2.cmml"><mi id="algorithm1.15.15.m1.2.2.2.2.2.2.2" xref="algorithm1.15.15.m1.2.2.2.2.2.2.2.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.2.2.2.2.2.2.1" xref="algorithm1.15.15.m1.2.2.2.2.2.2.1.cmml">​</mo><mi id="algorithm1.15.15.m1.2.2.2.2.2.2.3" xref="algorithm1.15.15.m1.2.2.2.2.2.2.3.cmml">c</mi></mrow><mo id="algorithm1.15.15.m1.3.3.3.3.3.6" xref="algorithm1.15.15.m1.3.3.3.3.4.cmml">,</mo><mrow id="algorithm1.15.15.m1.3.3.3.3.3.3" xref="algorithm1.15.15.m1.3.3.3.3.3.3.cmml"><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.2" xref="algorithm1.15.15.m1.3.3.3.3.3.3.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.3" xref="algorithm1.15.15.m1.3.3.3.3.3.3.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1a" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.4" xref="algorithm1.15.15.m1.3.3.3.3.3.3.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1b" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi mathvariant="normal" id="algorithm1.15.15.m1.3.3.3.3.3.3.5" xref="algorithm1.15.15.m1.3.3.3.3.3.3.5.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1c" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.6" xref="algorithm1.15.15.m1.3.3.3.3.3.3.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1d" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.7" xref="algorithm1.15.15.m1.3.3.3.3.3.3.7.cmml">y</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1e" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.8" xref="algorithm1.15.15.m1.3.3.3.3.3.3.8.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm1.15.15.m1.3.3.3.3.3.3.1f" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml">​</mo><mi id="algorithm1.15.15.m1.3.3.3.3.3.3.9" xref="algorithm1.15.15.m1.3.3.3.3.3.3.9.cmml">e</mi></mrow><mo stretchy="false" id="algorithm1.15.15.m1.3.3.3.3.3.7" xref="algorithm1.15.15.m1.3.3.3.3.4.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.15.15.m1.3b"><apply id="algorithm1.15.15.m1.3.3.cmml" xref="algorithm1.15.15.m1.3.3"><ci id="algorithm1.15.15.m1.3.3.4.cmml" xref="algorithm1.15.15.m1.3.3.4">←</ci><apply id="algorithm1.15.15.m1.3.3.5.cmml" xref="algorithm1.15.15.m1.3.3.5"><times id="algorithm1.15.15.m1.3.3.5.1.cmml" xref="algorithm1.15.15.m1.3.3.5.1"></times><ci id="algorithm1.15.15.m1.3.3.5.2.cmml" xref="algorithm1.15.15.m1.3.3.5.2">𝑛</ci><ci id="algorithm1.15.15.m1.3.3.5.3.cmml" xref="algorithm1.15.15.m1.3.3.5.3">𝑒</ci><ci id="algorithm1.15.15.m1.3.3.5.4.cmml" xref="algorithm1.15.15.m1.3.3.5.4">𝑤</ci><ci id="algorithm1.15.15.m1.3.3.5.5.cmml" xref="algorithm1.15.15.m1.3.3.5.5">_</ci><ci id="algorithm1.15.15.m1.3.3.5.6.cmml" xref="algorithm1.15.15.m1.3.3.5.6">𝑏</ci><ci id="algorithm1.15.15.m1.3.3.5.7.cmml" xref="algorithm1.15.15.m1.3.3.5.7">𝑜</ci><ci id="algorithm1.15.15.m1.3.3.5.8.cmml" xref="algorithm1.15.15.m1.3.3.5.8">𝑢</ci><ci id="algorithm1.15.15.m1.3.3.5.9.cmml" xref="algorithm1.15.15.m1.3.3.5.9">𝑛</ci><ci id="algorithm1.15.15.m1.3.3.5.10.cmml" xref="algorithm1.15.15.m1.3.3.5.10">𝑑</ci><ci id="algorithm1.15.15.m1.3.3.5.11.cmml" xref="algorithm1.15.15.m1.3.3.5.11">𝑠</ci></apply><apply id="algorithm1.15.15.m1.3.3.3.cmml" xref="algorithm1.15.15.m1.3.3.3"><times id="algorithm1.15.15.m1.3.3.3.4.cmml" xref="algorithm1.15.15.m1.3.3.3.4"></times><ci id="algorithm1.15.15.m1.3.3.3.5a.cmml" xref="algorithm1.15.15.m1.3.3.3.5"><mtext id="algorithm1.15.15.m1.3.3.3.5.cmml" xref="algorithm1.15.15.m1.3.3.3.5">dfs</mtext></ci><vector id="algorithm1.15.15.m1.3.3.3.3.4.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3"><apply id="algorithm1.15.15.m1.1.1.1.1.1.1.cmml" xref="algorithm1.15.15.m1.1.1.1.1.1.1"><times id="algorithm1.15.15.m1.1.1.1.1.1.1.1.cmml" xref="algorithm1.15.15.m1.1.1.1.1.1.1.1"></times><ci id="algorithm1.15.15.m1.1.1.1.1.1.1.2.cmml" xref="algorithm1.15.15.m1.1.1.1.1.1.1.2">𝑡</ci><ci id="algorithm1.15.15.m1.1.1.1.1.1.1.3.cmml" xref="algorithm1.15.15.m1.1.1.1.1.1.1.3">𝑟</ci></apply><apply id="algorithm1.15.15.m1.2.2.2.2.2.2.cmml" xref="algorithm1.15.15.m1.2.2.2.2.2.2"><times id="algorithm1.15.15.m1.2.2.2.2.2.2.1.cmml" xref="algorithm1.15.15.m1.2.2.2.2.2.2.1"></times><ci id="algorithm1.15.15.m1.2.2.2.2.2.2.2.cmml" xref="algorithm1.15.15.m1.2.2.2.2.2.2.2">𝑡</ci><ci id="algorithm1.15.15.m1.2.2.2.2.2.2.3.cmml" xref="algorithm1.15.15.m1.2.2.2.2.2.2.3">𝑐</ci></apply><apply id="algorithm1.15.15.m1.3.3.3.3.3.3.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3"><times id="algorithm1.15.15.m1.3.3.3.3.3.3.1.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.1"></times><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.2.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.2">𝑣</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.3.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.3">𝑎</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.4.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.4">𝑙</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.5.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.5">_</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.6.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.6">𝑡</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.7.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.7">𝑦</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.8.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.8">𝑝</ci><ci id="algorithm1.15.15.m1.3.3.3.3.3.3.9.cmml" xref="algorithm1.15.15.m1.3.3.3.3.3.3.9">𝑒</ci></apply></vector></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.15.15.m1.3c">new\_bounds\leftarrow\text{dfs}(tr,tc,val\_type)</annotation></semantics></math>;
</div>
<div id="algorithm1.26.31" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">15</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
update bounds to include new_bounds;
</div>
<div id="algorithm1.26.32" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">16</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm1.26.33" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">17</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
</div>
<div id="algorithm1.26.34" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">18</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   <span id="algorithm1.26.34.1" class="ltx_text ltx_font_bold">return</span> bounds;
</div>
<div id="algorithm1.26.35" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">19</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm1.26.36" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">20</span>
</div>
<div id="algorithm1.17.17" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">21</span><span id="algorithm1.17.17.3" class="ltx_text ltx_font_bold">for</span> <em id="algorithm1.17.17.2" class="ltx_emph ltx_font_italic"><math id="algorithm1.16.16.1.m1.1" class="ltx_Math" alttext="r=0" display="inline"><semantics id="algorithm1.16.16.1.m1.1a"><mrow id="algorithm1.16.16.1.m1.1.1" xref="algorithm1.16.16.1.m1.1.1.cmml"><mi id="algorithm1.16.16.1.m1.1.1.2" xref="algorithm1.16.16.1.m1.1.1.2.cmml">r</mi><mo id="algorithm1.16.16.1.m1.1.1.1" xref="algorithm1.16.16.1.m1.1.1.1.cmml">=</mo><mn id="algorithm1.16.16.1.m1.1.1.3" xref="algorithm1.16.16.1.m1.1.1.3.cmml">0</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.16.16.1.m1.1b"><apply id="algorithm1.16.16.1.m1.1.1.cmml" xref="algorithm1.16.16.1.m1.1.1"><eq id="algorithm1.16.16.1.m1.1.1.1.cmml" xref="algorithm1.16.16.1.m1.1.1.1"></eq><ci id="algorithm1.16.16.1.m1.1.1.2.cmml" xref="algorithm1.16.16.1.m1.1.1.2">𝑟</ci><cn type="integer" id="algorithm1.16.16.1.m1.1.1.3.cmml" xref="algorithm1.16.16.1.m1.1.1.3">0</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.16.16.1.m1.1c">r=0</annotation></semantics></math> <span id="algorithm1.17.17.2.1" class="ltx_text ltx_font_bold ltx_font_upright">to</span> <math id="algorithm1.17.17.2.m2.1" class="ltx_Math" alttext="m-1" display="inline"><semantics id="algorithm1.17.17.2.m2.1a"><mrow id="algorithm1.17.17.2.m2.1.1" xref="algorithm1.17.17.2.m2.1.1.cmml"><mi id="algorithm1.17.17.2.m2.1.1.2" xref="algorithm1.17.17.2.m2.1.1.2.cmml">m</mi><mo id="algorithm1.17.17.2.m2.1.1.1" xref="algorithm1.17.17.2.m2.1.1.1.cmml">−</mo><mn id="algorithm1.17.17.2.m2.1.1.3" xref="algorithm1.17.17.2.m2.1.1.3.cmml">1</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.17.17.2.m2.1b"><apply id="algorithm1.17.17.2.m2.1.1.cmml" xref="algorithm1.17.17.2.m2.1.1"><minus id="algorithm1.17.17.2.m2.1.1.1.cmml" xref="algorithm1.17.17.2.m2.1.1.1"></minus><ci id="algorithm1.17.17.2.m2.1.1.2.cmml" xref="algorithm1.17.17.2.m2.1.1.2">𝑚</ci><cn type="integer" id="algorithm1.17.17.2.m2.1.1.3.cmml" xref="algorithm1.17.17.2.m2.1.1.3">1</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.17.17.2.m2.1c">m-1</annotation></semantics></math></em> <span id="algorithm1.17.17.4" class="ltx_text ltx_font_bold">do</span>
</div>
<div id="algorithm1.19.19" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">22</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.19.19.3" class="ltx_text ltx_font_bold">for</span> <em id="algorithm1.19.19.2" class="ltx_emph ltx_font_italic"><math id="algorithm1.18.18.1.m1.1" class="ltx_Math" alttext="c=0" display="inline"><semantics id="algorithm1.18.18.1.m1.1a"><mrow id="algorithm1.18.18.1.m1.1.1" xref="algorithm1.18.18.1.m1.1.1.cmml"><mi id="algorithm1.18.18.1.m1.1.1.2" xref="algorithm1.18.18.1.m1.1.1.2.cmml">c</mi><mo id="algorithm1.18.18.1.m1.1.1.1" xref="algorithm1.18.18.1.m1.1.1.1.cmml">=</mo><mn id="algorithm1.18.18.1.m1.1.1.3" xref="algorithm1.18.18.1.m1.1.1.3.cmml">0</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.18.18.1.m1.1b"><apply id="algorithm1.18.18.1.m1.1.1.cmml" xref="algorithm1.18.18.1.m1.1.1"><eq id="algorithm1.18.18.1.m1.1.1.1.cmml" xref="algorithm1.18.18.1.m1.1.1.1"></eq><ci id="algorithm1.18.18.1.m1.1.1.2.cmml" xref="algorithm1.18.18.1.m1.1.1.2">𝑐</ci><cn type="integer" id="algorithm1.18.18.1.m1.1.1.3.cmml" xref="algorithm1.18.18.1.m1.1.1.3">0</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.18.18.1.m1.1c">c=0</annotation></semantics></math> <span id="algorithm1.19.19.2.1" class="ltx_text ltx_font_bold ltx_font_upright">to</span> <math id="algorithm1.19.19.2.m2.1" class="ltx_Math" alttext="n-1" display="inline"><semantics id="algorithm1.19.19.2.m2.1a"><mrow id="algorithm1.19.19.2.m2.1.1" xref="algorithm1.19.19.2.m2.1.1.cmml"><mi id="algorithm1.19.19.2.m2.1.1.2" xref="algorithm1.19.19.2.m2.1.1.2.cmml">n</mi><mo id="algorithm1.19.19.2.m2.1.1.1" xref="algorithm1.19.19.2.m2.1.1.1.cmml">−</mo><mn id="algorithm1.19.19.2.m2.1.1.3" xref="algorithm1.19.19.2.m2.1.1.3.cmml">1</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.19.19.2.m2.1b"><apply id="algorithm1.19.19.2.m2.1.1.cmml" xref="algorithm1.19.19.2.m2.1.1"><minus id="algorithm1.19.19.2.m2.1.1.1.cmml" xref="algorithm1.19.19.2.m2.1.1.1"></minus><ci id="algorithm1.19.19.2.m2.1.1.2.cmml" xref="algorithm1.19.19.2.m2.1.1.2">𝑛</ci><cn type="integer" id="algorithm1.19.19.2.m2.1.1.3.cmml" xref="algorithm1.19.19.2.m2.1.1.3">1</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.19.19.2.m2.1c">n-1</annotation></semantics></math></em> <span id="algorithm1.19.19.4" class="ltx_text ltx_font_bold">do</span>
</div>
<div id="algorithm1.20.20" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">23</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm1.20.20.2" class="ltx_text ltx_font_bold">if</span> <em id="algorithm1.20.20.1" class="ltx_emph ltx_font_italic"><math id="algorithm1.20.20.1.m1.2" class="ltx_Math" alttext="\neg visited[r][c]" display="inline"><semantics id="algorithm1.20.20.1.m1.2a"><mrow id="algorithm1.20.20.1.m1.2.3" xref="algorithm1.20.20.1.m1.2.3.cmml"><mo rspace="0.167em" id="algorithm1.20.20.1.m1.2.3.1" xref="algorithm1.20.20.1.m1.2.3.1.cmml">¬</mo><mrow id="algorithm1.20.20.1.m1.2.3.2" xref="algorithm1.20.20.1.m1.2.3.2.cmml"><mi id="algorithm1.20.20.1.m1.2.3.2.2" xref="algorithm1.20.20.1.m1.2.3.2.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.3" xref="algorithm1.20.20.1.m1.2.3.2.3.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1a" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.4" xref="algorithm1.20.20.1.m1.2.3.2.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1b" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.5" xref="algorithm1.20.20.1.m1.2.3.2.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1c" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.6" xref="algorithm1.20.20.1.m1.2.3.2.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1d" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.7" xref="algorithm1.20.20.1.m1.2.3.2.7.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1e" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mi id="algorithm1.20.20.1.m1.2.3.2.8" xref="algorithm1.20.20.1.m1.2.3.2.8.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1f" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mrow id="algorithm1.20.20.1.m1.2.3.2.9.2" xref="algorithm1.20.20.1.m1.2.3.2.9.1.cmml"><mo stretchy="false" id="algorithm1.20.20.1.m1.2.3.2.9.2.1" xref="algorithm1.20.20.1.m1.2.3.2.9.1.1.cmml">[</mo><mi id="algorithm1.20.20.1.m1.1.1" xref="algorithm1.20.20.1.m1.1.1.cmml">r</mi><mo stretchy="false" id="algorithm1.20.20.1.m1.2.3.2.9.2.2" xref="algorithm1.20.20.1.m1.2.3.2.9.1.1.cmml">]</mo></mrow><mo lspace="0em" rspace="0em" id="algorithm1.20.20.1.m1.2.3.2.1g" xref="algorithm1.20.20.1.m1.2.3.2.1.cmml">​</mo><mrow id="algorithm1.20.20.1.m1.2.3.2.10.2" xref="algorithm1.20.20.1.m1.2.3.2.10.1.cmml"><mo stretchy="false" id="algorithm1.20.20.1.m1.2.3.2.10.2.1" xref="algorithm1.20.20.1.m1.2.3.2.10.1.1.cmml">[</mo><mi id="algorithm1.20.20.1.m1.2.2" xref="algorithm1.20.20.1.m1.2.2.cmml">c</mi><mo stretchy="false" id="algorithm1.20.20.1.m1.2.3.2.10.2.2" xref="algorithm1.20.20.1.m1.2.3.2.10.1.1.cmml">]</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.20.20.1.m1.2b"><apply id="algorithm1.20.20.1.m1.2.3.cmml" xref="algorithm1.20.20.1.m1.2.3"><not id="algorithm1.20.20.1.m1.2.3.1.cmml" xref="algorithm1.20.20.1.m1.2.3.1"></not><apply id="algorithm1.20.20.1.m1.2.3.2.cmml" xref="algorithm1.20.20.1.m1.2.3.2"><times id="algorithm1.20.20.1.m1.2.3.2.1.cmml" xref="algorithm1.20.20.1.m1.2.3.2.1"></times><ci id="algorithm1.20.20.1.m1.2.3.2.2.cmml" xref="algorithm1.20.20.1.m1.2.3.2.2">𝑣</ci><ci id="algorithm1.20.20.1.m1.2.3.2.3.cmml" xref="algorithm1.20.20.1.m1.2.3.2.3">𝑖</ci><ci id="algorithm1.20.20.1.m1.2.3.2.4.cmml" xref="algorithm1.20.20.1.m1.2.3.2.4">𝑠</ci><ci id="algorithm1.20.20.1.m1.2.3.2.5.cmml" xref="algorithm1.20.20.1.m1.2.3.2.5">𝑖</ci><ci id="algorithm1.20.20.1.m1.2.3.2.6.cmml" xref="algorithm1.20.20.1.m1.2.3.2.6">𝑡</ci><ci id="algorithm1.20.20.1.m1.2.3.2.7.cmml" xref="algorithm1.20.20.1.m1.2.3.2.7">𝑒</ci><ci id="algorithm1.20.20.1.m1.2.3.2.8.cmml" xref="algorithm1.20.20.1.m1.2.3.2.8">𝑑</ci><apply id="algorithm1.20.20.1.m1.2.3.2.9.1.cmml" xref="algorithm1.20.20.1.m1.2.3.2.9.2"><csymbol cd="latexml" id="algorithm1.20.20.1.m1.2.3.2.9.1.1.cmml" xref="algorithm1.20.20.1.m1.2.3.2.9.2.1">delimited-[]</csymbol><ci id="algorithm1.20.20.1.m1.1.1.cmml" xref="algorithm1.20.20.1.m1.1.1">𝑟</ci></apply><apply id="algorithm1.20.20.1.m1.2.3.2.10.1.cmml" xref="algorithm1.20.20.1.m1.2.3.2.10.2"><csymbol cd="latexml" id="algorithm1.20.20.1.m1.2.3.2.10.1.1.cmml" xref="algorithm1.20.20.1.m1.2.3.2.10.2.1">delimited-[]</csymbol><ci id="algorithm1.20.20.1.m1.2.2.cmml" xref="algorithm1.20.20.1.m1.2.2">𝑐</ci></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.20.20.1.m1.2c">\neg visited[r][c]</annotation></semantics></math></em> <span id="algorithm1.20.20.3" class="ltx_text ltx_font_bold">then</span>
</div>
<div id="algorithm1.21.21" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">24</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm1.21.21.m1.3" class="ltx_Math" alttext="val\_type\leftarrow\text{FormatDict}[nfs[r,c]]" display="inline"><semantics id="algorithm1.21.21.m1.3a"><mrow id="algorithm1.21.21.m1.3.3" xref="algorithm1.21.21.m1.3.3.cmml"><mrow id="algorithm1.21.21.m1.3.3.3" xref="algorithm1.21.21.m1.3.3.3.cmml"><mi id="algorithm1.21.21.m1.3.3.3.2" xref="algorithm1.21.21.m1.3.3.3.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.3" xref="algorithm1.21.21.m1.3.3.3.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1a" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.4" xref="algorithm1.21.21.m1.3.3.3.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1b" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi mathvariant="normal" id="algorithm1.21.21.m1.3.3.3.5" xref="algorithm1.21.21.m1.3.3.3.5.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1c" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.6" xref="algorithm1.21.21.m1.3.3.3.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1d" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.7" xref="algorithm1.21.21.m1.3.3.3.7.cmml">y</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1e" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.8" xref="algorithm1.21.21.m1.3.3.3.8.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.3.1f" xref="algorithm1.21.21.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.3.9" xref="algorithm1.21.21.m1.3.3.3.9.cmml">e</mi></mrow><mo stretchy="false" id="algorithm1.21.21.m1.3.3.2" xref="algorithm1.21.21.m1.3.3.2.cmml">←</mo><mrow id="algorithm1.21.21.m1.3.3.1" xref="algorithm1.21.21.m1.3.3.1.cmml"><mtext id="algorithm1.21.21.m1.3.3.1.3" xref="algorithm1.21.21.m1.3.3.1.3a.cmml">FormatDict</mtext><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.1.2" xref="algorithm1.21.21.m1.3.3.1.2.cmml">​</mo><mrow id="algorithm1.21.21.m1.3.3.1.1.1" xref="algorithm1.21.21.m1.3.3.1.1.2.cmml"><mo stretchy="false" id="algorithm1.21.21.m1.3.3.1.1.1.2" xref="algorithm1.21.21.m1.3.3.1.1.2.1.cmml">[</mo><mrow id="algorithm1.21.21.m1.3.3.1.1.1.1" xref="algorithm1.21.21.m1.3.3.1.1.1.1.cmml"><mi id="algorithm1.21.21.m1.3.3.1.1.1.1.2" xref="algorithm1.21.21.m1.3.3.1.1.1.1.2.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.1.1.1.1.1" xref="algorithm1.21.21.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.1.1.1.1.3" xref="algorithm1.21.21.m1.3.3.1.1.1.1.3.cmml">f</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.1.1.1.1.1a" xref="algorithm1.21.21.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.21.21.m1.3.3.1.1.1.1.4" xref="algorithm1.21.21.m1.3.3.1.1.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.21.21.m1.3.3.1.1.1.1.1b" xref="algorithm1.21.21.m1.3.3.1.1.1.1.1.cmml">​</mo><mrow id="algorithm1.21.21.m1.3.3.1.1.1.1.5.2" xref="algorithm1.21.21.m1.3.3.1.1.1.1.5.1.cmml"><mo stretchy="false" id="algorithm1.21.21.m1.3.3.1.1.1.1.5.2.1" xref="algorithm1.21.21.m1.3.3.1.1.1.1.5.1.cmml">[</mo><mi id="algorithm1.21.21.m1.1.1" xref="algorithm1.21.21.m1.1.1.cmml">r</mi><mo id="algorithm1.21.21.m1.3.3.1.1.1.1.5.2.2" xref="algorithm1.21.21.m1.3.3.1.1.1.1.5.1.cmml">,</mo><mi id="algorithm1.21.21.m1.2.2" xref="algorithm1.21.21.m1.2.2.cmml">c</mi><mo stretchy="false" id="algorithm1.21.21.m1.3.3.1.1.1.1.5.2.3" xref="algorithm1.21.21.m1.3.3.1.1.1.1.5.1.cmml">]</mo></mrow></mrow><mo stretchy="false" id="algorithm1.21.21.m1.3.3.1.1.1.3" xref="algorithm1.21.21.m1.3.3.1.1.2.1.cmml">]</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.21.21.m1.3b"><apply id="algorithm1.21.21.m1.3.3.cmml" xref="algorithm1.21.21.m1.3.3"><ci id="algorithm1.21.21.m1.3.3.2.cmml" xref="algorithm1.21.21.m1.3.3.2">←</ci><apply id="algorithm1.21.21.m1.3.3.3.cmml" xref="algorithm1.21.21.m1.3.3.3"><times id="algorithm1.21.21.m1.3.3.3.1.cmml" xref="algorithm1.21.21.m1.3.3.3.1"></times><ci id="algorithm1.21.21.m1.3.3.3.2.cmml" xref="algorithm1.21.21.m1.3.3.3.2">𝑣</ci><ci id="algorithm1.21.21.m1.3.3.3.3.cmml" xref="algorithm1.21.21.m1.3.3.3.3">𝑎</ci><ci id="algorithm1.21.21.m1.3.3.3.4.cmml" xref="algorithm1.21.21.m1.3.3.3.4">𝑙</ci><ci id="algorithm1.21.21.m1.3.3.3.5.cmml" xref="algorithm1.21.21.m1.3.3.3.5">_</ci><ci id="algorithm1.21.21.m1.3.3.3.6.cmml" xref="algorithm1.21.21.m1.3.3.3.6">𝑡</ci><ci id="algorithm1.21.21.m1.3.3.3.7.cmml" xref="algorithm1.21.21.m1.3.3.3.7">𝑦</ci><ci id="algorithm1.21.21.m1.3.3.3.8.cmml" xref="algorithm1.21.21.m1.3.3.3.8">𝑝</ci><ci id="algorithm1.21.21.m1.3.3.3.9.cmml" xref="algorithm1.21.21.m1.3.3.3.9">𝑒</ci></apply><apply id="algorithm1.21.21.m1.3.3.1.cmml" xref="algorithm1.21.21.m1.3.3.1"><times id="algorithm1.21.21.m1.3.3.1.2.cmml" xref="algorithm1.21.21.m1.3.3.1.2"></times><ci id="algorithm1.21.21.m1.3.3.1.3a.cmml" xref="algorithm1.21.21.m1.3.3.1.3"><mtext id="algorithm1.21.21.m1.3.3.1.3.cmml" xref="algorithm1.21.21.m1.3.3.1.3">FormatDict</mtext></ci><apply id="algorithm1.21.21.m1.3.3.1.1.2.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1"><csymbol cd="latexml" id="algorithm1.21.21.m1.3.3.1.1.2.1.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.2">delimited-[]</csymbol><apply id="algorithm1.21.21.m1.3.3.1.1.1.1.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1"><times id="algorithm1.21.21.m1.3.3.1.1.1.1.1.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1.1"></times><ci id="algorithm1.21.21.m1.3.3.1.1.1.1.2.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1.2">𝑛</ci><ci id="algorithm1.21.21.m1.3.3.1.1.1.1.3.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1.3">𝑓</ci><ci id="algorithm1.21.21.m1.3.3.1.1.1.1.4.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1.4">𝑠</ci><interval closure="closed" id="algorithm1.21.21.m1.3.3.1.1.1.1.5.1.cmml" xref="algorithm1.21.21.m1.3.3.1.1.1.1.5.2"><ci id="algorithm1.21.21.m1.1.1.cmml" xref="algorithm1.21.21.m1.1.1">𝑟</ci><ci id="algorithm1.21.21.m1.2.2.cmml" xref="algorithm1.21.21.m1.2.2">𝑐</ci></interval></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.21.21.m1.3c">val\_type\leftarrow\text{FormatDict}[nfs[r,c]]</annotation></semantics></math>;
</div>
<div id="algorithm1.22.22" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">25</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm1.22.22.m1.3" class="ltx_Math" alttext="bounds\leftarrow\text{dfs}(r,c,val\_type)" display="inline"><semantics id="algorithm1.22.22.m1.3a"><mrow id="algorithm1.22.22.m1.3.3" xref="algorithm1.22.22.m1.3.3.cmml"><mrow id="algorithm1.22.22.m1.3.3.3" xref="algorithm1.22.22.m1.3.3.3.cmml"><mi id="algorithm1.22.22.m1.3.3.3.2" xref="algorithm1.22.22.m1.3.3.3.2.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.3.1" xref="algorithm1.22.22.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.3.3" xref="algorithm1.22.22.m1.3.3.3.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.3.1a" xref="algorithm1.22.22.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.3.4" xref="algorithm1.22.22.m1.3.3.3.4.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.3.1b" xref="algorithm1.22.22.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.3.5" xref="algorithm1.22.22.m1.3.3.3.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.3.1c" xref="algorithm1.22.22.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.3.6" xref="algorithm1.22.22.m1.3.3.3.6.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.3.1d" xref="algorithm1.22.22.m1.3.3.3.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.3.7" xref="algorithm1.22.22.m1.3.3.3.7.cmml">s</mi></mrow><mo stretchy="false" id="algorithm1.22.22.m1.3.3.2" xref="algorithm1.22.22.m1.3.3.2.cmml">←</mo><mrow id="algorithm1.22.22.m1.3.3.1" xref="algorithm1.22.22.m1.3.3.1.cmml"><mtext id="algorithm1.22.22.m1.3.3.1.3" xref="algorithm1.22.22.m1.3.3.1.3a.cmml">dfs</mtext><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.2" xref="algorithm1.22.22.m1.3.3.1.2.cmml">​</mo><mrow id="algorithm1.22.22.m1.3.3.1.1.1" xref="algorithm1.22.22.m1.3.3.1.1.2.cmml"><mo stretchy="false" id="algorithm1.22.22.m1.3.3.1.1.1.2" xref="algorithm1.22.22.m1.3.3.1.1.2.cmml">(</mo><mi id="algorithm1.22.22.m1.1.1" xref="algorithm1.22.22.m1.1.1.cmml">r</mi><mo id="algorithm1.22.22.m1.3.3.1.1.1.3" xref="algorithm1.22.22.m1.3.3.1.1.2.cmml">,</mo><mi id="algorithm1.22.22.m1.2.2" xref="algorithm1.22.22.m1.2.2.cmml">c</mi><mo id="algorithm1.22.22.m1.3.3.1.1.1.4" xref="algorithm1.22.22.m1.3.3.1.1.2.cmml">,</mo><mrow id="algorithm1.22.22.m1.3.3.1.1.1.1" xref="algorithm1.22.22.m1.3.3.1.1.1.1.cmml"><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.2" xref="algorithm1.22.22.m1.3.3.1.1.1.1.2.cmml">v</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.3" xref="algorithm1.22.22.m1.3.3.1.1.1.1.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1a" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.4" xref="algorithm1.22.22.m1.3.3.1.1.1.1.4.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1b" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi mathvariant="normal" id="algorithm1.22.22.m1.3.3.1.1.1.1.5" xref="algorithm1.22.22.m1.3.3.1.1.1.1.5.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1c" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.6" xref="algorithm1.22.22.m1.3.3.1.1.1.1.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1d" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.7" xref="algorithm1.22.22.m1.3.3.1.1.1.1.7.cmml">y</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1e" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.8" xref="algorithm1.22.22.m1.3.3.1.1.1.1.8.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm1.22.22.m1.3.3.1.1.1.1.1f" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.22.22.m1.3.3.1.1.1.1.9" xref="algorithm1.22.22.m1.3.3.1.1.1.1.9.cmml">e</mi></mrow><mo stretchy="false" id="algorithm1.22.22.m1.3.3.1.1.1.5" xref="algorithm1.22.22.m1.3.3.1.1.2.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.22.22.m1.3b"><apply id="algorithm1.22.22.m1.3.3.cmml" xref="algorithm1.22.22.m1.3.3"><ci id="algorithm1.22.22.m1.3.3.2.cmml" xref="algorithm1.22.22.m1.3.3.2">←</ci><apply id="algorithm1.22.22.m1.3.3.3.cmml" xref="algorithm1.22.22.m1.3.3.3"><times id="algorithm1.22.22.m1.3.3.3.1.cmml" xref="algorithm1.22.22.m1.3.3.3.1"></times><ci id="algorithm1.22.22.m1.3.3.3.2.cmml" xref="algorithm1.22.22.m1.3.3.3.2">𝑏</ci><ci id="algorithm1.22.22.m1.3.3.3.3.cmml" xref="algorithm1.22.22.m1.3.3.3.3">𝑜</ci><ci id="algorithm1.22.22.m1.3.3.3.4.cmml" xref="algorithm1.22.22.m1.3.3.3.4">𝑢</ci><ci id="algorithm1.22.22.m1.3.3.3.5.cmml" xref="algorithm1.22.22.m1.3.3.3.5">𝑛</ci><ci id="algorithm1.22.22.m1.3.3.3.6.cmml" xref="algorithm1.22.22.m1.3.3.3.6">𝑑</ci><ci id="algorithm1.22.22.m1.3.3.3.7.cmml" xref="algorithm1.22.22.m1.3.3.3.7">𝑠</ci></apply><apply id="algorithm1.22.22.m1.3.3.1.cmml" xref="algorithm1.22.22.m1.3.3.1"><times id="algorithm1.22.22.m1.3.3.1.2.cmml" xref="algorithm1.22.22.m1.3.3.1.2"></times><ci id="algorithm1.22.22.m1.3.3.1.3a.cmml" xref="algorithm1.22.22.m1.3.3.1.3"><mtext id="algorithm1.22.22.m1.3.3.1.3.cmml" xref="algorithm1.22.22.m1.3.3.1.3">dfs</mtext></ci><vector id="algorithm1.22.22.m1.3.3.1.1.2.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1"><ci id="algorithm1.22.22.m1.1.1.cmml" xref="algorithm1.22.22.m1.1.1">𝑟</ci><ci id="algorithm1.22.22.m1.2.2.cmml" xref="algorithm1.22.22.m1.2.2">𝑐</ci><apply id="algorithm1.22.22.m1.3.3.1.1.1.1.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1"><times id="algorithm1.22.22.m1.3.3.1.1.1.1.1.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.1"></times><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.2.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.2">𝑣</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.3.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.3">𝑎</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.4.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.4">𝑙</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.5.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.5">_</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.6.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.6">𝑡</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.7.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.7">𝑦</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.8.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.8">𝑝</ci><ci id="algorithm1.22.22.m1.3.3.1.1.1.1.9.cmml" xref="algorithm1.22.22.m1.3.3.1.1.1.1.9">𝑒</ci></apply></vector></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.22.22.m1.3c">bounds\leftarrow\text{dfs}(r,c,val\_type)</annotation></semantics></math>;
</div>
<div id="algorithm1.23.23" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">26</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm1.23.23.m1.2" class="ltx_math_unparsed" alttext="areas\leftarrow areas+((bounds[0],bounds[1])," display="inline"><semantics id="algorithm1.23.23.m1.2a"><mrow id="algorithm1.23.23.m1.2b"><mi id="algorithm1.23.23.m1.2.3">a</mi><mi id="algorithm1.23.23.m1.2.4">r</mi><mi id="algorithm1.23.23.m1.2.5">e</mi><mi id="algorithm1.23.23.m1.2.6">a</mi><mi id="algorithm1.23.23.m1.2.7">s</mi><mo stretchy="false" id="algorithm1.23.23.m1.2.8">←</mo><mi id="algorithm1.23.23.m1.2.9">a</mi><mi id="algorithm1.23.23.m1.2.10">r</mi><mi id="algorithm1.23.23.m1.2.11">e</mi><mi id="algorithm1.23.23.m1.2.12">a</mi><mi id="algorithm1.23.23.m1.2.13">s</mi><mo id="algorithm1.23.23.m1.2.14">+</mo><mrow id="algorithm1.23.23.m1.2.15"><mo stretchy="false" id="algorithm1.23.23.m1.2.15.1">(</mo><mrow id="algorithm1.23.23.m1.2.15.2"><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.1">(</mo><mi id="algorithm1.23.23.m1.2.15.2.2">b</mi><mi id="algorithm1.23.23.m1.2.15.2.3">o</mi><mi id="algorithm1.23.23.m1.2.15.2.4">u</mi><mi id="algorithm1.23.23.m1.2.15.2.5">n</mi><mi id="algorithm1.23.23.m1.2.15.2.6">d</mi><mi id="algorithm1.23.23.m1.2.15.2.7">s</mi><mrow id="algorithm1.23.23.m1.2.15.2.8"><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.8.1">[</mo><mn id="algorithm1.23.23.m1.1.1">0</mn><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.8.2">]</mo></mrow><mo id="algorithm1.23.23.m1.2.15.2.9">,</mo><mi id="algorithm1.23.23.m1.2.15.2.10">b</mi><mi id="algorithm1.23.23.m1.2.15.2.11">o</mi><mi id="algorithm1.23.23.m1.2.15.2.12">u</mi><mi id="algorithm1.23.23.m1.2.15.2.13">n</mi><mi id="algorithm1.23.23.m1.2.15.2.14">d</mi><mi id="algorithm1.23.23.m1.2.15.2.15">s</mi><mrow id="algorithm1.23.23.m1.2.15.2.16"><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.16.1">[</mo><mn id="algorithm1.23.23.m1.2.2">1</mn><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.16.2">]</mo></mrow><mo stretchy="false" id="algorithm1.23.23.m1.2.15.2.17">)</mo></mrow><mo id="algorithm1.23.23.m1.2.15.3">,</mo></mrow></mrow><annotation encoding="application/x-tex" id="algorithm1.23.23.m1.2c">areas\leftarrow areas+((bounds[0],bounds[1]),</annotation></semantics></math>

</div>
<div id="algorithm1.24.24" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">27</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   <math id="algorithm1.24.24.m1.3" class="ltx_Math" alttext="\ (bounds[2],bounds[3])," display="inline"><semantics id="algorithm1.24.24.m1.3a"><mrow id="algorithm1.24.24.m1.3.3.1"><mrow id="algorithm1.24.24.m1.3.3.1.1.2" xref="algorithm1.24.24.m1.3.3.1.1.3.cmml"><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.2.3" xref="algorithm1.24.24.m1.3.3.1.1.3.cmml">(</mo><mrow id="algorithm1.24.24.m1.3.3.1.1.1.1" xref="algorithm1.24.24.m1.3.3.1.1.1.1.cmml"><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.2" xref="algorithm1.24.24.m1.3.3.1.1.1.1.2.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.3" xref="algorithm1.24.24.m1.3.3.1.1.1.1.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1a" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.4" xref="algorithm1.24.24.m1.3.3.1.1.1.1.4.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1b" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.5" xref="algorithm1.24.24.m1.3.3.1.1.1.1.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1c" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.6" xref="algorithm1.24.24.m1.3.3.1.1.1.1.6.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1d" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.1.1.7" xref="algorithm1.24.24.m1.3.3.1.1.1.1.7.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.1.1.1e" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml">​</mo><mrow id="algorithm1.24.24.m1.3.3.1.1.1.1.8.2" xref="algorithm1.24.24.m1.3.3.1.1.1.1.8.1.cmml"><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.1.1.8.2.1" xref="algorithm1.24.24.m1.3.3.1.1.1.1.8.1.1.cmml">[</mo><mn id="algorithm1.24.24.m1.1.1" xref="algorithm1.24.24.m1.1.1.cmml">2</mn><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.1.1.8.2.2" xref="algorithm1.24.24.m1.3.3.1.1.1.1.8.1.1.cmml">]</mo></mrow></mrow><mo id="algorithm1.24.24.m1.3.3.1.1.2.4" xref="algorithm1.24.24.m1.3.3.1.1.3.cmml">,</mo><mrow id="algorithm1.24.24.m1.3.3.1.1.2.2" xref="algorithm1.24.24.m1.3.3.1.1.2.2.cmml"><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.2" xref="algorithm1.24.24.m1.3.3.1.1.2.2.2.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.3" xref="algorithm1.24.24.m1.3.3.1.1.2.2.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1a" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.4" xref="algorithm1.24.24.m1.3.3.1.1.2.2.4.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1b" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.5" xref="algorithm1.24.24.m1.3.3.1.1.2.2.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1c" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.6" xref="algorithm1.24.24.m1.3.3.1.1.2.2.6.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1d" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mi id="algorithm1.24.24.m1.3.3.1.1.2.2.7" xref="algorithm1.24.24.m1.3.3.1.1.2.2.7.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm1.24.24.m1.3.3.1.1.2.2.1e" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml">​</mo><mrow id="algorithm1.24.24.m1.3.3.1.1.2.2.8.2" xref="algorithm1.24.24.m1.3.3.1.1.2.2.8.1.cmml"><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.2.2.8.2.1" xref="algorithm1.24.24.m1.3.3.1.1.2.2.8.1.1.cmml">[</mo><mn id="algorithm1.24.24.m1.2.2" xref="algorithm1.24.24.m1.2.2.cmml">3</mn><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.2.2.8.2.2" xref="algorithm1.24.24.m1.3.3.1.1.2.2.8.1.1.cmml">]</mo></mrow></mrow><mo stretchy="false" id="algorithm1.24.24.m1.3.3.1.1.2.5" xref="algorithm1.24.24.m1.3.3.1.1.3.cmml">)</mo></mrow><mo id="algorithm1.24.24.m1.3.3.1.2">,</mo></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.24.24.m1.3b"><interval closure="open" id="algorithm1.24.24.m1.3.3.1.1.3.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2"><apply id="algorithm1.24.24.m1.3.3.1.1.1.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1"><times id="algorithm1.24.24.m1.3.3.1.1.1.1.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.1"></times><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.2.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.2">𝑏</ci><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.3.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.3">𝑜</ci><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.4.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.4">𝑢</ci><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.5.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.5">𝑛</ci><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.6.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.6">𝑑</ci><ci id="algorithm1.24.24.m1.3.3.1.1.1.1.7.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.7">𝑠</ci><apply id="algorithm1.24.24.m1.3.3.1.1.1.1.8.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.8.2"><csymbol cd="latexml" id="algorithm1.24.24.m1.3.3.1.1.1.1.8.1.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.1.1.8.2.1">delimited-[]</csymbol><cn type="integer" id="algorithm1.24.24.m1.1.1.cmml" xref="algorithm1.24.24.m1.1.1">2</cn></apply></apply><apply id="algorithm1.24.24.m1.3.3.1.1.2.2.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2"><times id="algorithm1.24.24.m1.3.3.1.1.2.2.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.1"></times><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.2.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.2">𝑏</ci><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.3.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.3">𝑜</ci><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.4.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.4">𝑢</ci><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.5.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.5">𝑛</ci><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.6.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.6">𝑑</ci><ci id="algorithm1.24.24.m1.3.3.1.1.2.2.7.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.7">𝑠</ci><apply id="algorithm1.24.24.m1.3.3.1.1.2.2.8.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.8.2"><csymbol cd="latexml" id="algorithm1.24.24.m1.3.3.1.1.2.2.8.1.1.cmml" xref="algorithm1.24.24.m1.3.3.1.1.2.2.8.2.1">delimited-[]</csymbol><cn type="integer" id="algorithm1.24.24.m1.2.2.cmml" xref="algorithm1.24.24.m1.2.2">3</cn></apply></apply></interval></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.24.24.m1.3c">\ (bounds[2],bounds[3]),</annotation></semantics></math>

</div>
<div id="algorithm1.25.25" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">28</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   <math id="algorithm1.25.25.m1.1" class="ltx_math_unparsed" alttext="\ val\_type);" display="inline"><semantics id="algorithm1.25.25.m1.1a"><mrow id="algorithm1.25.25.m1.1b"><mi id="algorithm1.25.25.m1.1.1">v</mi><mi id="algorithm1.25.25.m1.1.2">a</mi><mi id="algorithm1.25.25.m1.1.3">l</mi><mi mathvariant="normal" id="algorithm1.25.25.m1.1.4">_</mi><mi id="algorithm1.25.25.m1.1.5">t</mi><mi id="algorithm1.25.25.m1.1.6">y</mi><mi id="algorithm1.25.25.m1.1.7">p</mi><mi id="algorithm1.25.25.m1.1.8">e</mi><mo stretchy="false" id="algorithm1.25.25.m1.1.9">)</mo><mo id="algorithm1.25.25.m1.1.10">;</mo></mrow><annotation encoding="application/x-tex" id="algorithm1.25.25.m1.1c">\ val\_type);</annotation></semantics></math>

</div>
<div id="algorithm1.26.37" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">29</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
</div>
<div id="algorithm1.26.38" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">30</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
</div>
<div id="algorithm1.26.39" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">31</span>
</div>
<div id="algorithm1.26.26" class="ltx_listingline">
<span id="algorithm1.26.26.1" class="ltx_text ltx_font_bold">Output :</span> Aggregation matrix <math id="algorithm1.26.26.m1.1" class="ltx_Math" alttext="areas" display="inline"><semantics id="algorithm1.26.26.m1.1a"><mrow id="algorithm1.26.26.m1.1.1" xref="algorithm1.26.26.m1.1.1.cmml"><mi id="algorithm1.26.26.m1.1.1.2" xref="algorithm1.26.26.m1.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.26.26.m1.1.1.1" xref="algorithm1.26.26.m1.1.1.1.cmml">​</mo><mi id="algorithm1.26.26.m1.1.1.3" xref="algorithm1.26.26.m1.1.1.3.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm1.26.26.m1.1.1.1a" xref="algorithm1.26.26.m1.1.1.1.cmml">​</mo><mi id="algorithm1.26.26.m1.1.1.4" xref="algorithm1.26.26.m1.1.1.4.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm1.26.26.m1.1.1.1b" xref="algorithm1.26.26.m1.1.1.1.cmml">​</mo><mi id="algorithm1.26.26.m1.1.1.5" xref="algorithm1.26.26.m1.1.1.5.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm1.26.26.m1.1.1.1c" xref="algorithm1.26.26.m1.1.1.1.cmml">​</mo><mi id="algorithm1.26.26.m1.1.1.6" xref="algorithm1.26.26.m1.1.1.6.cmml">s</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm1.26.26.m1.1b"><apply id="algorithm1.26.26.m1.1.1.cmml" xref="algorithm1.26.26.m1.1.1"><times id="algorithm1.26.26.m1.1.1.1.cmml" xref="algorithm1.26.26.m1.1.1.1"></times><ci id="algorithm1.26.26.m1.1.1.2.cmml" xref="algorithm1.26.26.m1.1.1.2">𝑎</ci><ci id="algorithm1.26.26.m1.1.1.3.cmml" xref="algorithm1.26.26.m1.1.1.3">𝑟</ci><ci id="algorithm1.26.26.m1.1.1.4.cmml" xref="algorithm1.26.26.m1.1.1.4">𝑒</ci><ci id="algorithm1.26.26.m1.1.1.5.cmml" xref="algorithm1.26.26.m1.1.1.5">𝑎</ci><ci id="algorithm1.26.26.m1.1.1.6.cmml" xref="algorithm1.26.26.m1.1.1.6">𝑠</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm1.26.26.m1.1c">areas</annotation></semantics></math>, each cell which is filled with the corresponding datatype after applying custom rules.
</div>
<div id="algorithm1.26.40" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">32</span>

</div>
<div id="algorithm1.26.41" class="ltx_listingline">
</div>
</div>
<figcaption class="ltx_caption"><span class="ltx_tag ltx_tag_float"><span id="algorithm1.28.1.1" class="ltx_text ltx_font_bold">Algorithm 1</span> </span>Identical Cell Aggregation</figcaption>
</figure>
</section>
<section id="A13.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">M.2 </span>Table Split QA Algorithm</h3>

<div id="A13.SS2.p1" class="ltx_para">
<p id="A13.SS2.p1.1" class="ltx_p">The corresponding algorithm steps are shown in Algorithm <a href="#algorithm2" title="In M.2 Table Split QA Algorithm ‣ Appendix M Algorithm Steps ‣ SpreadsheetLLM: Encoding Spreadsheets for Large Language Models" class="ltx_ref"><span class="ltx_text ltx_ref_tag">2</span></a>.</p>
</div>
<figure id="algorithm2" class="ltx_float ltx_algorithm">
<div id="algorithm2.13" class="ltx_listing ltx_lst_numbers_left ltx_listing">
<div id="algorithm2.13.14" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">1</span>




</div>
<div id="algorithm2.2.2" class="ltx_listingline">
<span id="algorithm2.2.2.1" class="ltx_text ltx_font_bold">Input :</span> <math id="algorithm2.1.1.m1.1" class="ltx_Math" alttext="question" display="inline"><semantics id="algorithm2.1.1.m1.1a"><mrow id="algorithm2.1.1.m1.1.1" xref="algorithm2.1.1.m1.1.1.cmml"><mi id="algorithm2.1.1.m1.1.1.2" xref="algorithm2.1.1.m1.1.1.2.cmml">q</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.3" xref="algorithm2.1.1.m1.1.1.3.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1a" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.4" xref="algorithm2.1.1.m1.1.1.4.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1b" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.5" xref="algorithm2.1.1.m1.1.1.5.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1c" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.6" xref="algorithm2.1.1.m1.1.1.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1d" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.7" xref="algorithm2.1.1.m1.1.1.7.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1e" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.8" xref="algorithm2.1.1.m1.1.1.8.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.1.1.m1.1.1.1f" xref="algorithm2.1.1.m1.1.1.1.cmml">​</mo><mi id="algorithm2.1.1.m1.1.1.9" xref="algorithm2.1.1.m1.1.1.9.cmml">n</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.1.1.m1.1b"><apply id="algorithm2.1.1.m1.1.1.cmml" xref="algorithm2.1.1.m1.1.1"><times id="algorithm2.1.1.m1.1.1.1.cmml" xref="algorithm2.1.1.m1.1.1.1"></times><ci id="algorithm2.1.1.m1.1.1.2.cmml" xref="algorithm2.1.1.m1.1.1.2">𝑞</ci><ci id="algorithm2.1.1.m1.1.1.3.cmml" xref="algorithm2.1.1.m1.1.1.3">𝑢</ci><ci id="algorithm2.1.1.m1.1.1.4.cmml" xref="algorithm2.1.1.m1.1.1.4">𝑒</ci><ci id="algorithm2.1.1.m1.1.1.5.cmml" xref="algorithm2.1.1.m1.1.1.5">𝑠</ci><ci id="algorithm2.1.1.m1.1.1.6.cmml" xref="algorithm2.1.1.m1.1.1.6">𝑡</ci><ci id="algorithm2.1.1.m1.1.1.7.cmml" xref="algorithm2.1.1.m1.1.1.7">𝑖</ci><ci id="algorithm2.1.1.m1.1.1.8.cmml" xref="algorithm2.1.1.m1.1.1.8">𝑜</ci><ci id="algorithm2.1.1.m1.1.1.9.cmml" xref="algorithm2.1.1.m1.1.1.9">𝑛</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.1.1.m1.1c">question</annotation></semantics></math> composed of strings and two-dimensional matrix <math id="algorithm2.2.2.m2.1" class="ltx_Math" alttext="region" display="inline"><semantics id="algorithm2.2.2.m2.1a"><mrow id="algorithm2.2.2.m2.1.1" xref="algorithm2.2.2.m2.1.1.cmml"><mi id="algorithm2.2.2.m2.1.1.2" xref="algorithm2.2.2.m2.1.1.2.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.2.2.m2.1.1.1" xref="algorithm2.2.2.m2.1.1.1.cmml">​</mo><mi id="algorithm2.2.2.m2.1.1.3" xref="algorithm2.2.2.m2.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.2.2.m2.1.1.1a" xref="algorithm2.2.2.m2.1.1.1.cmml">​</mo><mi id="algorithm2.2.2.m2.1.1.4" xref="algorithm2.2.2.m2.1.1.4.cmml">g</mi><mo lspace="0em" rspace="0em" id="algorithm2.2.2.m2.1.1.1b" xref="algorithm2.2.2.m2.1.1.1.cmml">​</mo><mi id="algorithm2.2.2.m2.1.1.5" xref="algorithm2.2.2.m2.1.1.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.2.2.m2.1.1.1c" xref="algorithm2.2.2.m2.1.1.1.cmml">​</mo><mi id="algorithm2.2.2.m2.1.1.6" xref="algorithm2.2.2.m2.1.1.6.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.2.2.m2.1.1.1d" xref="algorithm2.2.2.m2.1.1.1.cmml">​</mo><mi id="algorithm2.2.2.m2.1.1.7" xref="algorithm2.2.2.m2.1.1.7.cmml">n</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.2.2.m2.1b"><apply id="algorithm2.2.2.m2.1.1.cmml" xref="algorithm2.2.2.m2.1.1"><times id="algorithm2.2.2.m2.1.1.1.cmml" xref="algorithm2.2.2.m2.1.1.1"></times><ci id="algorithm2.2.2.m2.1.1.2.cmml" xref="algorithm2.2.2.m2.1.1.2">𝑟</ci><ci id="algorithm2.2.2.m2.1.1.3.cmml" xref="algorithm2.2.2.m2.1.1.3">𝑒</ci><ci id="algorithm2.2.2.m2.1.1.4.cmml" xref="algorithm2.2.2.m2.1.1.4">𝑔</ci><ci id="algorithm2.2.2.m2.1.1.5.cmml" xref="algorithm2.2.2.m2.1.1.5">𝑖</ci><ci id="algorithm2.2.2.m2.1.1.6.cmml" xref="algorithm2.2.2.m2.1.1.6">𝑜</ci><ci id="algorithm2.2.2.m2.1.1.7.cmml" xref="algorithm2.2.2.m2.1.1.7">𝑛</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.2.2.m2.1c">region</annotation></semantics></math>
</div>
<div id="algorithm2.13.15" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">2</span>

</div>
<div id="algorithm2.4.4" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">3</span>Initialize <math id="algorithm2.3.3.m1.1" class="ltx_Math" alttext="header" display="inline"><semantics id="algorithm2.3.3.m1.1a"><mrow id="algorithm2.3.3.m1.1.1" xref="algorithm2.3.3.m1.1.1.cmml"><mi id="algorithm2.3.3.m1.1.1.2" xref="algorithm2.3.3.m1.1.1.2.cmml">h</mi><mo lspace="0em" rspace="0em" id="algorithm2.3.3.m1.1.1.1" xref="algorithm2.3.3.m1.1.1.1.cmml">​</mo><mi id="algorithm2.3.3.m1.1.1.3" xref="algorithm2.3.3.m1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.3.3.m1.1.1.1a" xref="algorithm2.3.3.m1.1.1.1.cmml">​</mo><mi id="algorithm2.3.3.m1.1.1.4" xref="algorithm2.3.3.m1.1.1.4.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.3.3.m1.1.1.1b" xref="algorithm2.3.3.m1.1.1.1.cmml">​</mo><mi id="algorithm2.3.3.m1.1.1.5" xref="algorithm2.3.3.m1.1.1.5.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.3.3.m1.1.1.1c" xref="algorithm2.3.3.m1.1.1.1.cmml">​</mo><mi id="algorithm2.3.3.m1.1.1.6" xref="algorithm2.3.3.m1.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.3.3.m1.1.1.1d" xref="algorithm2.3.3.m1.1.1.1.cmml">​</mo><mi id="algorithm2.3.3.m1.1.1.7" xref="algorithm2.3.3.m1.1.1.7.cmml">r</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.3.3.m1.1b"><apply id="algorithm2.3.3.m1.1.1.cmml" xref="algorithm2.3.3.m1.1.1"><times id="algorithm2.3.3.m1.1.1.1.cmml" xref="algorithm2.3.3.m1.1.1.1"></times><ci id="algorithm2.3.3.m1.1.1.2.cmml" xref="algorithm2.3.3.m1.1.1.2">ℎ</ci><ci id="algorithm2.3.3.m1.1.1.3.cmml" xref="algorithm2.3.3.m1.1.1.3">𝑒</ci><ci id="algorithm2.3.3.m1.1.1.4.cmml" xref="algorithm2.3.3.m1.1.1.4">𝑎</ci><ci id="algorithm2.3.3.m1.1.1.5.cmml" xref="algorithm2.3.3.m1.1.1.5">𝑑</ci><ci id="algorithm2.3.3.m1.1.1.6.cmml" xref="algorithm2.3.3.m1.1.1.6">𝑒</ci><ci id="algorithm2.3.3.m1.1.1.7.cmml" xref="algorithm2.3.3.m1.1.1.7">𝑟</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.3.3.m1.1c">header</annotation></semantics></math> and <math id="algorithm2.4.4.m2.1" class="ltx_Math" alttext="answers" display="inline"><semantics id="algorithm2.4.4.m2.1a"><mrow id="algorithm2.4.4.m2.1.1" xref="algorithm2.4.4.m2.1.1.cmml"><mi id="algorithm2.4.4.m2.1.1.2" xref="algorithm2.4.4.m2.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.3" xref="algorithm2.4.4.m2.1.1.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1a" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.4" xref="algorithm2.4.4.m2.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1b" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.5" xref="algorithm2.4.4.m2.1.1.5.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1c" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.6" xref="algorithm2.4.4.m2.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1d" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.7" xref="algorithm2.4.4.m2.1.1.7.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.4.4.m2.1.1.1e" xref="algorithm2.4.4.m2.1.1.1.cmml">​</mo><mi id="algorithm2.4.4.m2.1.1.8" xref="algorithm2.4.4.m2.1.1.8.cmml">s</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.4.4.m2.1b"><apply id="algorithm2.4.4.m2.1.1.cmml" xref="algorithm2.4.4.m2.1.1"><times id="algorithm2.4.4.m2.1.1.1.cmml" xref="algorithm2.4.4.m2.1.1.1"></times><ci id="algorithm2.4.4.m2.1.1.2.cmml" xref="algorithm2.4.4.m2.1.1.2">𝑎</ci><ci id="algorithm2.4.4.m2.1.1.3.cmml" xref="algorithm2.4.4.m2.1.1.3">𝑛</ci><ci id="algorithm2.4.4.m2.1.1.4.cmml" xref="algorithm2.4.4.m2.1.1.4">𝑠</ci><ci id="algorithm2.4.4.m2.1.1.5.cmml" xref="algorithm2.4.4.m2.1.1.5">𝑤</ci><ci id="algorithm2.4.4.m2.1.1.6.cmml" xref="algorithm2.4.4.m2.1.1.6">𝑒</ci><ci id="algorithm2.4.4.m2.1.1.7.cmml" xref="algorithm2.4.4.m2.1.1.7">𝑟</ci><ci id="algorithm2.4.4.m2.1.1.8.cmml" xref="algorithm2.4.4.m2.1.1.8">𝑠</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.4.4.m2.1c">answers</annotation></semantics></math> to empty lists

</div>
<div id="algorithm2.5.5" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">4</span><span id="algorithm2.5.5.2" class="ltx_text ltx_font_bold">if</span> <em id="algorithm2.5.5.1" class="ltx_emph ltx_font_italic"><math id="algorithm2.5.5.1.m1.1" class="ltx_Math" alttext="calculateTokens(region)\leq 4096" display="inline"><semantics id="algorithm2.5.5.1.m1.1a"><mrow id="algorithm2.5.5.1.m1.1.1" xref="algorithm2.5.5.1.m1.1.1.cmml"><mrow id="algorithm2.5.5.1.m1.1.1.1" xref="algorithm2.5.5.1.m1.1.1.1.cmml"><mi id="algorithm2.5.5.1.m1.1.1.1.3" xref="algorithm2.5.5.1.m1.1.1.1.3.cmml">c</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.4" xref="algorithm2.5.5.1.m1.1.1.1.4.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2a" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.5" xref="algorithm2.5.5.1.m1.1.1.1.5.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2b" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.6" xref="algorithm2.5.5.1.m1.1.1.1.6.cmml">c</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2c" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.7" xref="algorithm2.5.5.1.m1.1.1.1.7.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2d" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.8" xref="algorithm2.5.5.1.m1.1.1.1.8.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2e" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.9" xref="algorithm2.5.5.1.m1.1.1.1.9.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2f" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.10" xref="algorithm2.5.5.1.m1.1.1.1.10.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2g" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.11" xref="algorithm2.5.5.1.m1.1.1.1.11.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2h" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.12" xref="algorithm2.5.5.1.m1.1.1.1.12.cmml">T</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2i" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.13" xref="algorithm2.5.5.1.m1.1.1.1.13.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2j" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.14" xref="algorithm2.5.5.1.m1.1.1.1.14.cmml">k</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2k" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.15" xref="algorithm2.5.5.1.m1.1.1.1.15.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2l" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.16" xref="algorithm2.5.5.1.m1.1.1.1.16.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2m" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.17" xref="algorithm2.5.5.1.m1.1.1.1.17.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.2n" xref="algorithm2.5.5.1.m1.1.1.1.2.cmml">​</mo><mrow id="algorithm2.5.5.1.m1.1.1.1.1.1" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.cmml"><mo stretchy="false" id="algorithm2.5.5.1.m1.1.1.1.1.1.2" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.cmml">(</mo><mrow id="algorithm2.5.5.1.m1.1.1.1.1.1.1" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.cmml"><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.2" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.2.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.3" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1a" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.4" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.4.cmml">g</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1b" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.5" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1c" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.6" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.6.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1d" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.5.5.1.m1.1.1.1.1.1.1.7" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.7.cmml">n</mi></mrow><mo stretchy="false" id="algorithm2.5.5.1.m1.1.1.1.1.1.3" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.cmml">)</mo></mrow></mrow><mo id="algorithm2.5.5.1.m1.1.1.2" xref="algorithm2.5.5.1.m1.1.1.2.cmml">≤</mo><mn id="algorithm2.5.5.1.m1.1.1.3" xref="algorithm2.5.5.1.m1.1.1.3.cmml">4096</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.5.5.1.m1.1b"><apply id="algorithm2.5.5.1.m1.1.1.cmml" xref="algorithm2.5.5.1.m1.1.1"><leq id="algorithm2.5.5.1.m1.1.1.2.cmml" xref="algorithm2.5.5.1.m1.1.1.2"></leq><apply id="algorithm2.5.5.1.m1.1.1.1.cmml" xref="algorithm2.5.5.1.m1.1.1.1"><times id="algorithm2.5.5.1.m1.1.1.1.2.cmml" xref="algorithm2.5.5.1.m1.1.1.1.2"></times><ci id="algorithm2.5.5.1.m1.1.1.1.3.cmml" xref="algorithm2.5.5.1.m1.1.1.1.3">𝑐</ci><ci id="algorithm2.5.5.1.m1.1.1.1.4.cmml" xref="algorithm2.5.5.1.m1.1.1.1.4">𝑎</ci><ci id="algorithm2.5.5.1.m1.1.1.1.5.cmml" xref="algorithm2.5.5.1.m1.1.1.1.5">𝑙</ci><ci id="algorithm2.5.5.1.m1.1.1.1.6.cmml" xref="algorithm2.5.5.1.m1.1.1.1.6">𝑐</ci><ci id="algorithm2.5.5.1.m1.1.1.1.7.cmml" xref="algorithm2.5.5.1.m1.1.1.1.7">𝑢</ci><ci id="algorithm2.5.5.1.m1.1.1.1.8.cmml" xref="algorithm2.5.5.1.m1.1.1.1.8">𝑙</ci><ci id="algorithm2.5.5.1.m1.1.1.1.9.cmml" xref="algorithm2.5.5.1.m1.1.1.1.9">𝑎</ci><ci id="algorithm2.5.5.1.m1.1.1.1.10.cmml" xref="algorithm2.5.5.1.m1.1.1.1.10">𝑡</ci><ci id="algorithm2.5.5.1.m1.1.1.1.11.cmml" xref="algorithm2.5.5.1.m1.1.1.1.11">𝑒</ci><ci id="algorithm2.5.5.1.m1.1.1.1.12.cmml" xref="algorithm2.5.5.1.m1.1.1.1.12">𝑇</ci><ci id="algorithm2.5.5.1.m1.1.1.1.13.cmml" xref="algorithm2.5.5.1.m1.1.1.1.13">𝑜</ci><ci id="algorithm2.5.5.1.m1.1.1.1.14.cmml" xref="algorithm2.5.5.1.m1.1.1.1.14">𝑘</ci><ci id="algorithm2.5.5.1.m1.1.1.1.15.cmml" xref="algorithm2.5.5.1.m1.1.1.1.15">𝑒</ci><ci id="algorithm2.5.5.1.m1.1.1.1.16.cmml" xref="algorithm2.5.5.1.m1.1.1.1.16">𝑛</ci><ci id="algorithm2.5.5.1.m1.1.1.1.17.cmml" xref="algorithm2.5.5.1.m1.1.1.1.17">𝑠</ci><apply id="algorithm2.5.5.1.m1.1.1.1.1.1.1.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1"><times id="algorithm2.5.5.1.m1.1.1.1.1.1.1.1.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.1"></times><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.2.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.2">𝑟</ci><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.3.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.3">𝑒</ci><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.4.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.4">𝑔</ci><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.5.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.5">𝑖</ci><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.6.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.6">𝑜</ci><ci id="algorithm2.5.5.1.m1.1.1.1.1.1.1.7.cmml" xref="algorithm2.5.5.1.m1.1.1.1.1.1.1.7">𝑛</ci></apply></apply><cn type="integer" id="algorithm2.5.5.1.m1.1.1.3.cmml" xref="algorithm2.5.5.1.m1.1.1.3">4096</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.5.5.1.m1.1c">calculateTokens(region)\leq 4096</annotation></semantics></math></em> <span id="algorithm2.5.5.3" class="ltx_text ltx_font_bold">then</span>
</div>
<div id="algorithm2.13.16" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">5</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<span id="algorithm2.13.16.1" class="ltx_text ltx_font_bold">return</span> answer_question(question, region);
</div>
<div id="algorithm2.13.17" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">6</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm2.13.18" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">7</span><span id="algorithm2.13.18.1" class="ltx_text ltx_font_bold">else</span>
</div>
<div id="algorithm2.6.6" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">8</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm2.6.6.m1.1" class="ltx_Math" alttext="header\leftarrow predict\_header(region)" display="inline"><semantics id="algorithm2.6.6.m1.1a"><mrow id="algorithm2.6.6.m1.1.1" xref="algorithm2.6.6.m1.1.1.cmml"><mrow id="algorithm2.6.6.m1.1.1.3" xref="algorithm2.6.6.m1.1.1.3.cmml"><mi id="algorithm2.6.6.m1.1.1.3.2" xref="algorithm2.6.6.m1.1.1.3.2.cmml">h</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.3.1" xref="algorithm2.6.6.m1.1.1.3.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.3.3" xref="algorithm2.6.6.m1.1.1.3.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.3.1a" xref="algorithm2.6.6.m1.1.1.3.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.3.4" xref="algorithm2.6.6.m1.1.1.3.4.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.3.1b" xref="algorithm2.6.6.m1.1.1.3.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.3.5" xref="algorithm2.6.6.m1.1.1.3.5.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.3.1c" xref="algorithm2.6.6.m1.1.1.3.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.3.6" xref="algorithm2.6.6.m1.1.1.3.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.3.1d" xref="algorithm2.6.6.m1.1.1.3.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.3.7" xref="algorithm2.6.6.m1.1.1.3.7.cmml">r</mi></mrow><mo stretchy="false" id="algorithm2.6.6.m1.1.1.2" xref="algorithm2.6.6.m1.1.1.2.cmml">←</mo><mrow id="algorithm2.6.6.m1.1.1.1" xref="algorithm2.6.6.m1.1.1.1.cmml"><mi id="algorithm2.6.6.m1.1.1.1.3" xref="algorithm2.6.6.m1.1.1.1.3.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.4" xref="algorithm2.6.6.m1.1.1.1.4.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2a" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.5" xref="algorithm2.6.6.m1.1.1.1.5.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2b" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.6" xref="algorithm2.6.6.m1.1.1.1.6.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2c" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.7" xref="algorithm2.6.6.m1.1.1.1.7.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2d" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.8" xref="algorithm2.6.6.m1.1.1.1.8.cmml">c</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2e" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.9" xref="algorithm2.6.6.m1.1.1.1.9.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2f" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi mathvariant="normal" id="algorithm2.6.6.m1.1.1.1.10" xref="algorithm2.6.6.m1.1.1.1.10.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2g" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.11" xref="algorithm2.6.6.m1.1.1.1.11.cmml">h</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2h" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.12" xref="algorithm2.6.6.m1.1.1.1.12.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2i" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.13" xref="algorithm2.6.6.m1.1.1.1.13.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2j" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.14" xref="algorithm2.6.6.m1.1.1.1.14.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2k" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.15" xref="algorithm2.6.6.m1.1.1.1.15.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2l" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.16" xref="algorithm2.6.6.m1.1.1.1.16.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.2m" xref="algorithm2.6.6.m1.1.1.1.2.cmml">​</mo><mrow id="algorithm2.6.6.m1.1.1.1.1.1" xref="algorithm2.6.6.m1.1.1.1.1.1.1.cmml"><mo stretchy="false" id="algorithm2.6.6.m1.1.1.1.1.1.2" xref="algorithm2.6.6.m1.1.1.1.1.1.1.cmml">(</mo><mrow id="algorithm2.6.6.m1.1.1.1.1.1.1" xref="algorithm2.6.6.m1.1.1.1.1.1.1.cmml"><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.2" xref="algorithm2.6.6.m1.1.1.1.1.1.1.2.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.1.1.1.1" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.3" xref="algorithm2.6.6.m1.1.1.1.1.1.1.3.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.1.1.1.1a" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.4" xref="algorithm2.6.6.m1.1.1.1.1.1.1.4.cmml">g</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.1.1.1.1b" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.5" xref="algorithm2.6.6.m1.1.1.1.1.1.1.5.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.1.1.1.1c" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.6" xref="algorithm2.6.6.m1.1.1.1.1.1.1.6.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.6.6.m1.1.1.1.1.1.1.1d" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.6.6.m1.1.1.1.1.1.1.7" xref="algorithm2.6.6.m1.1.1.1.1.1.1.7.cmml">n</mi></mrow><mo stretchy="false" id="algorithm2.6.6.m1.1.1.1.1.1.3" xref="algorithm2.6.6.m1.1.1.1.1.1.1.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.6.6.m1.1b"><apply id="algorithm2.6.6.m1.1.1.cmml" xref="algorithm2.6.6.m1.1.1"><ci id="algorithm2.6.6.m1.1.1.2.cmml" xref="algorithm2.6.6.m1.1.1.2">←</ci><apply id="algorithm2.6.6.m1.1.1.3.cmml" xref="algorithm2.6.6.m1.1.1.3"><times id="algorithm2.6.6.m1.1.1.3.1.cmml" xref="algorithm2.6.6.m1.1.1.3.1"></times><ci id="algorithm2.6.6.m1.1.1.3.2.cmml" xref="algorithm2.6.6.m1.1.1.3.2">ℎ</ci><ci id="algorithm2.6.6.m1.1.1.3.3.cmml" xref="algorithm2.6.6.m1.1.1.3.3">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.3.4.cmml" xref="algorithm2.6.6.m1.1.1.3.4">𝑎</ci><ci id="algorithm2.6.6.m1.1.1.3.5.cmml" xref="algorithm2.6.6.m1.1.1.3.5">𝑑</ci><ci id="algorithm2.6.6.m1.1.1.3.6.cmml" xref="algorithm2.6.6.m1.1.1.3.6">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.3.7.cmml" xref="algorithm2.6.6.m1.1.1.3.7">𝑟</ci></apply><apply id="algorithm2.6.6.m1.1.1.1.cmml" xref="algorithm2.6.6.m1.1.1.1"><times id="algorithm2.6.6.m1.1.1.1.2.cmml" xref="algorithm2.6.6.m1.1.1.1.2"></times><ci id="algorithm2.6.6.m1.1.1.1.3.cmml" xref="algorithm2.6.6.m1.1.1.1.3">𝑝</ci><ci id="algorithm2.6.6.m1.1.1.1.4.cmml" xref="algorithm2.6.6.m1.1.1.1.4">𝑟</ci><ci id="algorithm2.6.6.m1.1.1.1.5.cmml" xref="algorithm2.6.6.m1.1.1.1.5">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.1.6.cmml" xref="algorithm2.6.6.m1.1.1.1.6">𝑑</ci><ci id="algorithm2.6.6.m1.1.1.1.7.cmml" xref="algorithm2.6.6.m1.1.1.1.7">𝑖</ci><ci id="algorithm2.6.6.m1.1.1.1.8.cmml" xref="algorithm2.6.6.m1.1.1.1.8">𝑐</ci><ci id="algorithm2.6.6.m1.1.1.1.9.cmml" xref="algorithm2.6.6.m1.1.1.1.9">𝑡</ci><ci id="algorithm2.6.6.m1.1.1.1.10.cmml" xref="algorithm2.6.6.m1.1.1.1.10">_</ci><ci id="algorithm2.6.6.m1.1.1.1.11.cmml" xref="algorithm2.6.6.m1.1.1.1.11">ℎ</ci><ci id="algorithm2.6.6.m1.1.1.1.12.cmml" xref="algorithm2.6.6.m1.1.1.1.12">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.1.13.cmml" xref="algorithm2.6.6.m1.1.1.1.13">𝑎</ci><ci id="algorithm2.6.6.m1.1.1.1.14.cmml" xref="algorithm2.6.6.m1.1.1.1.14">𝑑</ci><ci id="algorithm2.6.6.m1.1.1.1.15.cmml" xref="algorithm2.6.6.m1.1.1.1.15">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.1.16.cmml" xref="algorithm2.6.6.m1.1.1.1.16">𝑟</ci><apply id="algorithm2.6.6.m1.1.1.1.1.1.1.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1"><times id="algorithm2.6.6.m1.1.1.1.1.1.1.1.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.1"></times><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.2.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.2">𝑟</ci><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.3.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.3">𝑒</ci><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.4.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.4">𝑔</ci><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.5.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.5">𝑖</ci><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.6.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.6">𝑜</ci><ci id="algorithm2.6.6.m1.1.1.1.1.1.1.7.cmml" xref="algorithm2.6.6.m1.1.1.1.1.1.1.7">𝑛</ci></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.6.6.m1.1c">header\leftarrow predict\_header(region)</annotation></semantics></math>;
</div>
<div id="algorithm2.7.7" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">9</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm2.7.7.m1.1" class="ltx_math_unparsed" alttext="body\leftarrow region[length(header)+1:end]" display="inline"><semantics id="algorithm2.7.7.m1.1a"><mrow id="algorithm2.7.7.m1.1b"><mi id="algorithm2.7.7.m1.1.1">b</mi><mi id="algorithm2.7.7.m1.1.2">o</mi><mi id="algorithm2.7.7.m1.1.3">d</mi><mi id="algorithm2.7.7.m1.1.4">y</mi><mo stretchy="false" id="algorithm2.7.7.m1.1.5">←</mo><mi id="algorithm2.7.7.m1.1.6">r</mi><mi id="algorithm2.7.7.m1.1.7">e</mi><mi id="algorithm2.7.7.m1.1.8">g</mi><mi id="algorithm2.7.7.m1.1.9">i</mi><mi id="algorithm2.7.7.m1.1.10">o</mi><mi id="algorithm2.7.7.m1.1.11">n</mi><mrow id="algorithm2.7.7.m1.1.12"><mo stretchy="false" id="algorithm2.7.7.m1.1.12.1">[</mo><mi id="algorithm2.7.7.m1.1.12.2">l</mi><mi id="algorithm2.7.7.m1.1.12.3">e</mi><mi id="algorithm2.7.7.m1.1.12.4">n</mi><mi id="algorithm2.7.7.m1.1.12.5">g</mi><mi id="algorithm2.7.7.m1.1.12.6">t</mi><mi id="algorithm2.7.7.m1.1.12.7">h</mi><mrow id="algorithm2.7.7.m1.1.12.8"><mo stretchy="false" id="algorithm2.7.7.m1.1.12.8.1">(</mo><mi id="algorithm2.7.7.m1.1.12.8.2">h</mi><mi id="algorithm2.7.7.m1.1.12.8.3">e</mi><mi id="algorithm2.7.7.m1.1.12.8.4">a</mi><mi id="algorithm2.7.7.m1.1.12.8.5">d</mi><mi id="algorithm2.7.7.m1.1.12.8.6">e</mi><mi id="algorithm2.7.7.m1.1.12.8.7">r</mi><mo stretchy="false" id="algorithm2.7.7.m1.1.12.8.8">)</mo></mrow><mo id="algorithm2.7.7.m1.1.12.9">+</mo><mn id="algorithm2.7.7.m1.1.12.10">1</mn><mo lspace="0.278em" rspace="0.278em" id="algorithm2.7.7.m1.1.12.11">:</mo><mi id="algorithm2.7.7.m1.1.12.12">e</mi><mi id="algorithm2.7.7.m1.1.12.13">n</mi><mi id="algorithm2.7.7.m1.1.12.14">d</mi><mo stretchy="false" id="algorithm2.7.7.m1.1.12.15">]</mo></mrow></mrow><annotation encoding="application/x-tex" id="algorithm2.7.7.m1.1c">body\leftarrow region[length(header)+1:end]</annotation></semantics></math>;
</div>
<div id="algorithm2.13.19" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">10</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm2.9.9" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">11</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   <span id="algorithm2.9.9.3" class="ltx_text ltx_font_bold">for</span> <em id="algorithm2.9.9.2" class="ltx_emph ltx_font_italic"><math id="algorithm2.8.8.1.m1.1" class="ltx_Math" alttext="i=0" display="inline"><semantics id="algorithm2.8.8.1.m1.1a"><mrow id="algorithm2.8.8.1.m1.1.1" xref="algorithm2.8.8.1.m1.1.1.cmml"><mi id="algorithm2.8.8.1.m1.1.1.2" xref="algorithm2.8.8.1.m1.1.1.2.cmml">i</mi><mo id="algorithm2.8.8.1.m1.1.1.1" xref="algorithm2.8.8.1.m1.1.1.1.cmml">=</mo><mn id="algorithm2.8.8.1.m1.1.1.3" xref="algorithm2.8.8.1.m1.1.1.3.cmml">0</mn></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.8.8.1.m1.1b"><apply id="algorithm2.8.8.1.m1.1.1.cmml" xref="algorithm2.8.8.1.m1.1.1"><eq id="algorithm2.8.8.1.m1.1.1.1.cmml" xref="algorithm2.8.8.1.m1.1.1.1"></eq><ci id="algorithm2.8.8.1.m1.1.1.2.cmml" xref="algorithm2.8.8.1.m1.1.1.2">𝑖</ci><cn type="integer" id="algorithm2.8.8.1.m1.1.1.3.cmml" xref="algorithm2.8.8.1.m1.1.1.3">0</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.8.8.1.m1.1c">i=0</annotation></semantics></math> <span id="algorithm2.9.9.2.1" class="ltx_text ltx_font_bold ltx_font_upright">to</span> <math id="algorithm2.9.9.2.m2.1" class="ltx_Math" alttext="length(body)" display="inline"><semantics id="algorithm2.9.9.2.m2.1a"><mrow id="algorithm2.9.9.2.m2.1.1" xref="algorithm2.9.9.2.m2.1.1.cmml"><mi id="algorithm2.9.9.2.m2.1.1.3" xref="algorithm2.9.9.2.m2.1.1.3.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.4" xref="algorithm2.9.9.2.m2.1.1.4.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2a" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.5" xref="algorithm2.9.9.2.m2.1.1.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2b" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.6" xref="algorithm2.9.9.2.m2.1.1.6.cmml">g</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2c" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.7" xref="algorithm2.9.9.2.m2.1.1.7.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2d" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.8" xref="algorithm2.9.9.2.m2.1.1.8.cmml">h</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.2e" xref="algorithm2.9.9.2.m2.1.1.2.cmml">​</mo><mrow id="algorithm2.9.9.2.m2.1.1.1.1" xref="algorithm2.9.9.2.m2.1.1.1.1.1.cmml"><mo stretchy="false" id="algorithm2.9.9.2.m2.1.1.1.1.2" xref="algorithm2.9.9.2.m2.1.1.1.1.1.cmml">(</mo><mrow id="algorithm2.9.9.2.m2.1.1.1.1.1" xref="algorithm2.9.9.2.m2.1.1.1.1.1.cmml"><mi id="algorithm2.9.9.2.m2.1.1.1.1.1.2" xref="algorithm2.9.9.2.m2.1.1.1.1.1.2.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.1.1.1.1" xref="algorithm2.9.9.2.m2.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.1.1.1.3" xref="algorithm2.9.9.2.m2.1.1.1.1.1.3.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.1.1.1.1a" xref="algorithm2.9.9.2.m2.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.1.1.1.4" xref="algorithm2.9.9.2.m2.1.1.1.1.1.4.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.9.9.2.m2.1.1.1.1.1.1b" xref="algorithm2.9.9.2.m2.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.9.9.2.m2.1.1.1.1.1.5" xref="algorithm2.9.9.2.m2.1.1.1.1.1.5.cmml">y</mi></mrow><mo stretchy="false" id="algorithm2.9.9.2.m2.1.1.1.1.3" xref="algorithm2.9.9.2.m2.1.1.1.1.1.cmml">)</mo></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.9.9.2.m2.1b"><apply id="algorithm2.9.9.2.m2.1.1.cmml" xref="algorithm2.9.9.2.m2.1.1"><times id="algorithm2.9.9.2.m2.1.1.2.cmml" xref="algorithm2.9.9.2.m2.1.1.2"></times><ci id="algorithm2.9.9.2.m2.1.1.3.cmml" xref="algorithm2.9.9.2.m2.1.1.3">𝑙</ci><ci id="algorithm2.9.9.2.m2.1.1.4.cmml" xref="algorithm2.9.9.2.m2.1.1.4">𝑒</ci><ci id="algorithm2.9.9.2.m2.1.1.5.cmml" xref="algorithm2.9.9.2.m2.1.1.5">𝑛</ci><ci id="algorithm2.9.9.2.m2.1.1.6.cmml" xref="algorithm2.9.9.2.m2.1.1.6">𝑔</ci><ci id="algorithm2.9.9.2.m2.1.1.7.cmml" xref="algorithm2.9.9.2.m2.1.1.7">𝑡</ci><ci id="algorithm2.9.9.2.m2.1.1.8.cmml" xref="algorithm2.9.9.2.m2.1.1.8">ℎ</ci><apply id="algorithm2.9.9.2.m2.1.1.1.1.1.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1"><times id="algorithm2.9.9.2.m2.1.1.1.1.1.1.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1.1.1"></times><ci id="algorithm2.9.9.2.m2.1.1.1.1.1.2.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1.1.2">𝑏</ci><ci id="algorithm2.9.9.2.m2.1.1.1.1.1.3.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1.1.3">𝑜</ci><ci id="algorithm2.9.9.2.m2.1.1.1.1.1.4.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1.1.4">𝑑</ci><ci id="algorithm2.9.9.2.m2.1.1.1.1.1.5.cmml" xref="algorithm2.9.9.2.m2.1.1.1.1.1.5">𝑦</ci></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.9.9.2.m2.1c">length(body)</annotation></semantics></math></em> <span id="algorithm2.9.9.4" class="ltx_text ltx_font_bold">do</span>
</div>
<div id="algorithm2.10.10" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">12</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm2.10.10.m1.1" class="ltx_math_unparsed" alttext="new\_table\leftarrow header+body[i:i+3]" display="inline"><semantics id="algorithm2.10.10.m1.1a"><mrow id="algorithm2.10.10.m1.1b"><mi id="algorithm2.10.10.m1.1.1">n</mi><mi id="algorithm2.10.10.m1.1.2">e</mi><mi id="algorithm2.10.10.m1.1.3">w</mi><mi mathvariant="normal" id="algorithm2.10.10.m1.1.4">_</mi><mi id="algorithm2.10.10.m1.1.5">t</mi><mi id="algorithm2.10.10.m1.1.6">a</mi><mi id="algorithm2.10.10.m1.1.7">b</mi><mi id="algorithm2.10.10.m1.1.8">l</mi><mi id="algorithm2.10.10.m1.1.9">e</mi><mo stretchy="false" id="algorithm2.10.10.m1.1.10">←</mo><mi id="algorithm2.10.10.m1.1.11">h</mi><mi id="algorithm2.10.10.m1.1.12">e</mi><mi id="algorithm2.10.10.m1.1.13">a</mi><mi id="algorithm2.10.10.m1.1.14">d</mi><mi id="algorithm2.10.10.m1.1.15">e</mi><mi id="algorithm2.10.10.m1.1.16">r</mi><mo id="algorithm2.10.10.m1.1.17">+</mo><mi id="algorithm2.10.10.m1.1.18">b</mi><mi id="algorithm2.10.10.m1.1.19">o</mi><mi id="algorithm2.10.10.m1.1.20">d</mi><mi id="algorithm2.10.10.m1.1.21">y</mi><mrow id="algorithm2.10.10.m1.1.22"><mo stretchy="false" id="algorithm2.10.10.m1.1.22.1">[</mo><mi id="algorithm2.10.10.m1.1.22.2">i</mi><mo lspace="0.278em" rspace="0.278em" id="algorithm2.10.10.m1.1.22.3">:</mo><mi id="algorithm2.10.10.m1.1.22.4">i</mi><mo id="algorithm2.10.10.m1.1.22.5">+</mo><mn id="algorithm2.10.10.m1.1.22.6">3</mn><mo stretchy="false" id="algorithm2.10.10.m1.1.22.7">]</mo></mrow></mrow><annotation encoding="application/x-tex" id="algorithm2.10.10.m1.1c">new\_table\leftarrow header+body[i:i+3]</annotation></semantics></math>;
</div>
<div id="algorithm2.11.11" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">13</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm2.11.11.m1.2" class="ltx_Math" alttext="answer\leftarrow answer\_question(question,table)" display="inline"><semantics id="algorithm2.11.11.m1.2a"><mrow id="algorithm2.11.11.m1.2.2" xref="algorithm2.11.11.m1.2.2.cmml"><mrow id="algorithm2.11.11.m1.2.2.4" xref="algorithm2.11.11.m1.2.2.4.cmml"><mi id="algorithm2.11.11.m1.2.2.4.2" xref="algorithm2.11.11.m1.2.2.4.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.4.1" xref="algorithm2.11.11.m1.2.2.4.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.4.3" xref="algorithm2.11.11.m1.2.2.4.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.4.1a" xref="algorithm2.11.11.m1.2.2.4.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.4.4" xref="algorithm2.11.11.m1.2.2.4.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.4.1b" xref="algorithm2.11.11.m1.2.2.4.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.4.5" xref="algorithm2.11.11.m1.2.2.4.5.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.4.1c" xref="algorithm2.11.11.m1.2.2.4.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.4.6" xref="algorithm2.11.11.m1.2.2.4.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.4.1d" xref="algorithm2.11.11.m1.2.2.4.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.4.7" xref="algorithm2.11.11.m1.2.2.4.7.cmml">r</mi></mrow><mo stretchy="false" id="algorithm2.11.11.m1.2.2.3" xref="algorithm2.11.11.m1.2.2.3.cmml">←</mo><mrow id="algorithm2.11.11.m1.2.2.2" xref="algorithm2.11.11.m1.2.2.2.cmml"><mi id="algorithm2.11.11.m1.2.2.2.4" xref="algorithm2.11.11.m1.2.2.2.4.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.5" xref="algorithm2.11.11.m1.2.2.2.5.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3a" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.6" xref="algorithm2.11.11.m1.2.2.2.6.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3b" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.7" xref="algorithm2.11.11.m1.2.2.2.7.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3c" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.8" xref="algorithm2.11.11.m1.2.2.2.8.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3d" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.9" xref="algorithm2.11.11.m1.2.2.2.9.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3e" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi mathvariant="normal" id="algorithm2.11.11.m1.2.2.2.10" xref="algorithm2.11.11.m1.2.2.2.10.cmml">_</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3f" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.11" xref="algorithm2.11.11.m1.2.2.2.11.cmml">q</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3g" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.12" xref="algorithm2.11.11.m1.2.2.2.12.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3h" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.13" xref="algorithm2.11.11.m1.2.2.2.13.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3i" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.14" xref="algorithm2.11.11.m1.2.2.2.14.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3j" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.15" xref="algorithm2.11.11.m1.2.2.2.15.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3k" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.16" xref="algorithm2.11.11.m1.2.2.2.16.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3l" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.17" xref="algorithm2.11.11.m1.2.2.2.17.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3m" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.18" xref="algorithm2.11.11.m1.2.2.2.18.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.3n" xref="algorithm2.11.11.m1.2.2.2.3.cmml">​</mo><mrow id="algorithm2.11.11.m1.2.2.2.2.2" xref="algorithm2.11.11.m1.2.2.2.2.3.cmml"><mo stretchy="false" id="algorithm2.11.11.m1.2.2.2.2.2.3" xref="algorithm2.11.11.m1.2.2.2.2.3.cmml">(</mo><mrow id="algorithm2.11.11.m1.1.1.1.1.1.1" xref="algorithm2.11.11.m1.1.1.1.1.1.1.cmml"><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.2" xref="algorithm2.11.11.m1.1.1.1.1.1.1.2.cmml">q</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.3" xref="algorithm2.11.11.m1.1.1.1.1.1.1.3.cmml">u</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1a" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.4" xref="algorithm2.11.11.m1.1.1.1.1.1.1.4.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1b" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.5" xref="algorithm2.11.11.m1.1.1.1.1.1.1.5.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1c" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.6" xref="algorithm2.11.11.m1.1.1.1.1.1.1.6.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1d" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.7" xref="algorithm2.11.11.m1.1.1.1.1.1.1.7.cmml">i</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1e" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.8" xref="algorithm2.11.11.m1.1.1.1.1.1.1.8.cmml">o</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.1.1.1.1.1.1.1f" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.11.11.m1.1.1.1.1.1.1.9" xref="algorithm2.11.11.m1.1.1.1.1.1.1.9.cmml">n</mi></mrow><mo id="algorithm2.11.11.m1.2.2.2.2.2.4" xref="algorithm2.11.11.m1.2.2.2.2.3.cmml">,</mo><mrow id="algorithm2.11.11.m1.2.2.2.2.2.2" xref="algorithm2.11.11.m1.2.2.2.2.2.2.cmml"><mi id="algorithm2.11.11.m1.2.2.2.2.2.2.2" xref="algorithm2.11.11.m1.2.2.2.2.2.2.2.cmml">t</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.2.2.2.1" xref="algorithm2.11.11.m1.2.2.2.2.2.2.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.2.2.2.3" xref="algorithm2.11.11.m1.2.2.2.2.2.2.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.2.2.2.1a" xref="algorithm2.11.11.m1.2.2.2.2.2.2.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.2.2.2.4" xref="algorithm2.11.11.m1.2.2.2.2.2.2.4.cmml">b</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.2.2.2.1b" xref="algorithm2.11.11.m1.2.2.2.2.2.2.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.2.2.2.5" xref="algorithm2.11.11.m1.2.2.2.2.2.2.5.cmml">l</mi><mo lspace="0em" rspace="0em" id="algorithm2.11.11.m1.2.2.2.2.2.2.1c" xref="algorithm2.11.11.m1.2.2.2.2.2.2.1.cmml">​</mo><mi id="algorithm2.11.11.m1.2.2.2.2.2.2.6" xref="algorithm2.11.11.m1.2.2.2.2.2.2.6.cmml">e</mi></mrow><mo stretchy="false" id="algorithm2.11.11.m1.2.2.2.2.2.5" xref="algorithm2.11.11.m1.2.2.2.2.3.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.11.11.m1.2b"><apply id="algorithm2.11.11.m1.2.2.cmml" xref="algorithm2.11.11.m1.2.2"><ci id="algorithm2.11.11.m1.2.2.3.cmml" xref="algorithm2.11.11.m1.2.2.3">←</ci><apply id="algorithm2.11.11.m1.2.2.4.cmml" xref="algorithm2.11.11.m1.2.2.4"><times id="algorithm2.11.11.m1.2.2.4.1.cmml" xref="algorithm2.11.11.m1.2.2.4.1"></times><ci id="algorithm2.11.11.m1.2.2.4.2.cmml" xref="algorithm2.11.11.m1.2.2.4.2">𝑎</ci><ci id="algorithm2.11.11.m1.2.2.4.3.cmml" xref="algorithm2.11.11.m1.2.2.4.3">𝑛</ci><ci id="algorithm2.11.11.m1.2.2.4.4.cmml" xref="algorithm2.11.11.m1.2.2.4.4">𝑠</ci><ci id="algorithm2.11.11.m1.2.2.4.5.cmml" xref="algorithm2.11.11.m1.2.2.4.5">𝑤</ci><ci id="algorithm2.11.11.m1.2.2.4.6.cmml" xref="algorithm2.11.11.m1.2.2.4.6">𝑒</ci><ci id="algorithm2.11.11.m1.2.2.4.7.cmml" xref="algorithm2.11.11.m1.2.2.4.7">𝑟</ci></apply><apply id="algorithm2.11.11.m1.2.2.2.cmml" xref="algorithm2.11.11.m1.2.2.2"><times id="algorithm2.11.11.m1.2.2.2.3.cmml" xref="algorithm2.11.11.m1.2.2.2.3"></times><ci id="algorithm2.11.11.m1.2.2.2.4.cmml" xref="algorithm2.11.11.m1.2.2.2.4">𝑎</ci><ci id="algorithm2.11.11.m1.2.2.2.5.cmml" xref="algorithm2.11.11.m1.2.2.2.5">𝑛</ci><ci id="algorithm2.11.11.m1.2.2.2.6.cmml" xref="algorithm2.11.11.m1.2.2.2.6">𝑠</ci><ci id="algorithm2.11.11.m1.2.2.2.7.cmml" xref="algorithm2.11.11.m1.2.2.2.7">𝑤</ci><ci id="algorithm2.11.11.m1.2.2.2.8.cmml" xref="algorithm2.11.11.m1.2.2.2.8">𝑒</ci><ci id="algorithm2.11.11.m1.2.2.2.9.cmml" xref="algorithm2.11.11.m1.2.2.2.9">𝑟</ci><ci id="algorithm2.11.11.m1.2.2.2.10.cmml" xref="algorithm2.11.11.m1.2.2.2.10">_</ci><ci id="algorithm2.11.11.m1.2.2.2.11.cmml" xref="algorithm2.11.11.m1.2.2.2.11">𝑞</ci><ci id="algorithm2.11.11.m1.2.2.2.12.cmml" xref="algorithm2.11.11.m1.2.2.2.12">𝑢</ci><ci id="algorithm2.11.11.m1.2.2.2.13.cmml" xref="algorithm2.11.11.m1.2.2.2.13">𝑒</ci><ci id="algorithm2.11.11.m1.2.2.2.14.cmml" xref="algorithm2.11.11.m1.2.2.2.14">𝑠</ci><ci id="algorithm2.11.11.m1.2.2.2.15.cmml" xref="algorithm2.11.11.m1.2.2.2.15">𝑡</ci><ci id="algorithm2.11.11.m1.2.2.2.16.cmml" xref="algorithm2.11.11.m1.2.2.2.16">𝑖</ci><ci id="algorithm2.11.11.m1.2.2.2.17.cmml" xref="algorithm2.11.11.m1.2.2.2.17">𝑜</ci><ci id="algorithm2.11.11.m1.2.2.2.18.cmml" xref="algorithm2.11.11.m1.2.2.2.18">𝑛</ci><interval closure="open" id="algorithm2.11.11.m1.2.2.2.2.3.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2"><apply id="algorithm2.11.11.m1.1.1.1.1.1.1.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1"><times id="algorithm2.11.11.m1.1.1.1.1.1.1.1.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.1"></times><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.2.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.2">𝑞</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.3.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.3">𝑢</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.4.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.4">𝑒</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.5.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.5">𝑠</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.6.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.6">𝑡</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.7.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.7">𝑖</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.8.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.8">𝑜</ci><ci id="algorithm2.11.11.m1.1.1.1.1.1.1.9.cmml" xref="algorithm2.11.11.m1.1.1.1.1.1.1.9">𝑛</ci></apply><apply id="algorithm2.11.11.m1.2.2.2.2.2.2.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2"><times id="algorithm2.11.11.m1.2.2.2.2.2.2.1.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.1"></times><ci id="algorithm2.11.11.m1.2.2.2.2.2.2.2.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.2">𝑡</ci><ci id="algorithm2.11.11.m1.2.2.2.2.2.2.3.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.3">𝑎</ci><ci id="algorithm2.11.11.m1.2.2.2.2.2.2.4.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.4">𝑏</ci><ci id="algorithm2.11.11.m1.2.2.2.2.2.2.5.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.5">𝑙</ci><ci id="algorithm2.11.11.m1.2.2.2.2.2.2.6.cmml" xref="algorithm2.11.11.m1.2.2.2.2.2.2.6">𝑒</ci></apply></interval></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.11.11.m1.2c">answer\leftarrow answer\_question(question,table)</annotation></semantics></math>;
</div>
<div id="algorithm2.12.12" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">14</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
<math id="algorithm2.12.12.m1.2" class="ltx_Math" alttext="answers.append(answer)" display="inline"><semantics id="algorithm2.12.12.m1.2a"><mrow id="algorithm2.12.12.m1.2.2.2" xref="algorithm2.12.12.m1.2.2.3.cmml"><mrow id="algorithm2.12.12.m1.1.1.1.1" xref="algorithm2.12.12.m1.1.1.1.1.cmml"><mi id="algorithm2.12.12.m1.1.1.1.1.2" xref="algorithm2.12.12.m1.1.1.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.3" xref="algorithm2.12.12.m1.1.1.1.1.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1a" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.4" xref="algorithm2.12.12.m1.1.1.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1b" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.5" xref="algorithm2.12.12.m1.1.1.1.1.5.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1c" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.6" xref="algorithm2.12.12.m1.1.1.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1d" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.7" xref="algorithm2.12.12.m1.1.1.1.1.7.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.1.1.1.1.1e" xref="algorithm2.12.12.m1.1.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.1.1.1.1.8" xref="algorithm2.12.12.m1.1.1.1.1.8.cmml">s</mi></mrow><mo lspace="0em" rspace="0.167em" id="algorithm2.12.12.m1.2.2.2.3" xref="algorithm2.12.12.m1.2.2.3a.cmml">.</mo><mrow id="algorithm2.12.12.m1.2.2.2.2" xref="algorithm2.12.12.m1.2.2.2.2.cmml"><mi id="algorithm2.12.12.m1.2.2.2.2.3" xref="algorithm2.12.12.m1.2.2.2.2.3.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.4" xref="algorithm2.12.12.m1.2.2.2.2.4.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2a" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.5" xref="algorithm2.12.12.m1.2.2.2.2.5.cmml">p</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2b" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.6" xref="algorithm2.12.12.m1.2.2.2.2.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2c" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.7" xref="algorithm2.12.12.m1.2.2.2.2.7.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2d" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.8" xref="algorithm2.12.12.m1.2.2.2.2.8.cmml">d</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.2e" xref="algorithm2.12.12.m1.2.2.2.2.2.cmml">​</mo><mrow id="algorithm2.12.12.m1.2.2.2.2.1.1" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.cmml"><mo stretchy="false" id="algorithm2.12.12.m1.2.2.2.2.1.1.2" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.cmml">(</mo><mrow id="algorithm2.12.12.m1.2.2.2.2.1.1.1" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.cmml"><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.2" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.3" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1a" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.4" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1b" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.5" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.5.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1c" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.6" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1d" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml">​</mo><mi id="algorithm2.12.12.m1.2.2.2.2.1.1.1.7" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.7.cmml">r</mi></mrow><mo stretchy="false" id="algorithm2.12.12.m1.2.2.2.2.1.1.3" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.cmml">)</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.12.12.m1.2b"><apply id="algorithm2.12.12.m1.2.2.3.cmml" xref="algorithm2.12.12.m1.2.2.2"><csymbol cd="ambiguous" id="algorithm2.12.12.m1.2.2.3a.cmml" xref="algorithm2.12.12.m1.2.2.2.3">formulae-sequence</csymbol><apply id="algorithm2.12.12.m1.1.1.1.1.cmml" xref="algorithm2.12.12.m1.1.1.1.1"><times id="algorithm2.12.12.m1.1.1.1.1.1.cmml" xref="algorithm2.12.12.m1.1.1.1.1.1"></times><ci id="algorithm2.12.12.m1.1.1.1.1.2.cmml" xref="algorithm2.12.12.m1.1.1.1.1.2">𝑎</ci><ci id="algorithm2.12.12.m1.1.1.1.1.3.cmml" xref="algorithm2.12.12.m1.1.1.1.1.3">𝑛</ci><ci id="algorithm2.12.12.m1.1.1.1.1.4.cmml" xref="algorithm2.12.12.m1.1.1.1.1.4">𝑠</ci><ci id="algorithm2.12.12.m1.1.1.1.1.5.cmml" xref="algorithm2.12.12.m1.1.1.1.1.5">𝑤</ci><ci id="algorithm2.12.12.m1.1.1.1.1.6.cmml" xref="algorithm2.12.12.m1.1.1.1.1.6">𝑒</ci><ci id="algorithm2.12.12.m1.1.1.1.1.7.cmml" xref="algorithm2.12.12.m1.1.1.1.1.7">𝑟</ci><ci id="algorithm2.12.12.m1.1.1.1.1.8.cmml" xref="algorithm2.12.12.m1.1.1.1.1.8">𝑠</ci></apply><apply id="algorithm2.12.12.m1.2.2.2.2.cmml" xref="algorithm2.12.12.m1.2.2.2.2"><times id="algorithm2.12.12.m1.2.2.2.2.2.cmml" xref="algorithm2.12.12.m1.2.2.2.2.2"></times><ci id="algorithm2.12.12.m1.2.2.2.2.3.cmml" xref="algorithm2.12.12.m1.2.2.2.2.3">𝑎</ci><ci id="algorithm2.12.12.m1.2.2.2.2.4.cmml" xref="algorithm2.12.12.m1.2.2.2.2.4">𝑝</ci><ci id="algorithm2.12.12.m1.2.2.2.2.5.cmml" xref="algorithm2.12.12.m1.2.2.2.2.5">𝑝</ci><ci id="algorithm2.12.12.m1.2.2.2.2.6.cmml" xref="algorithm2.12.12.m1.2.2.2.2.6">𝑒</ci><ci id="algorithm2.12.12.m1.2.2.2.2.7.cmml" xref="algorithm2.12.12.m1.2.2.2.2.7">𝑛</ci><ci id="algorithm2.12.12.m1.2.2.2.2.8.cmml" xref="algorithm2.12.12.m1.2.2.2.2.8">𝑑</ci><apply id="algorithm2.12.12.m1.2.2.2.2.1.1.1.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1"><times id="algorithm2.12.12.m1.2.2.2.2.1.1.1.1.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.1"></times><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.2.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.2">𝑎</ci><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.3.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.3">𝑛</ci><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.4.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.4">𝑠</ci><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.5.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.5">𝑤</ci><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.6.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.6">𝑒</ci><ci id="algorithm2.12.12.m1.2.2.2.2.1.1.1.7.cmml" xref="algorithm2.12.12.m1.2.2.2.2.1.1.1.7">𝑟</ci></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.12.12.m1.2c">answers.append(answer)</annotation></semantics></math>;
</div>
<div id="algorithm2.13.20" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">15</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>     <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   

</div>
<div id="algorithm2.13.21" class="ltx_listingline">
<span class="ltx_tag ltx_tag_listingline">16</span>  <span class="ltx_rule" style="width:1px;height:100%;background:black;display:inline-block;"> </span>   
</div>
<div id="algorithm2.13.13" class="ltx_listingline">
<span id="algorithm2.13.13.1" class="ltx_text ltx_font_bold">Output :</span> final result <math id="algorithm2.13.13.m1.1" class="ltx_Math" alttext="answers" display="inline"><semantics id="algorithm2.13.13.m1.1a"><mrow id="algorithm2.13.13.m1.1.1" xref="algorithm2.13.13.m1.1.1.cmml"><mi id="algorithm2.13.13.m1.1.1.2" xref="algorithm2.13.13.m1.1.1.2.cmml">a</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.3" xref="algorithm2.13.13.m1.1.1.3.cmml">n</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1a" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.4" xref="algorithm2.13.13.m1.1.1.4.cmml">s</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1b" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.5" xref="algorithm2.13.13.m1.1.1.5.cmml">w</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1c" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.6" xref="algorithm2.13.13.m1.1.1.6.cmml">e</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1d" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.7" xref="algorithm2.13.13.m1.1.1.7.cmml">r</mi><mo lspace="0em" rspace="0em" id="algorithm2.13.13.m1.1.1.1e" xref="algorithm2.13.13.m1.1.1.1.cmml">​</mo><mi id="algorithm2.13.13.m1.1.1.8" xref="algorithm2.13.13.m1.1.1.8.cmml">s</mi></mrow><annotation-xml encoding="MathML-Content" id="algorithm2.13.13.m1.1b"><apply id="algorithm2.13.13.m1.1.1.cmml" xref="algorithm2.13.13.m1.1.1"><times id="algorithm2.13.13.m1.1.1.1.cmml" xref="algorithm2.13.13.m1.1.1.1"></times><ci id="algorithm2.13.13.m1.1.1.2.cmml" xref="algorithm2.13.13.m1.1.1.2">𝑎</ci><ci id="algorithm2.13.13.m1.1.1.3.cmml" xref="algorithm2.13.13.m1.1.1.3">𝑛</ci><ci id="algorithm2.13.13.m1.1.1.4.cmml" xref="algorithm2.13.13.m1.1.1.4">𝑠</ci><ci id="algorithm2.13.13.m1.1.1.5.cmml" xref="algorithm2.13.13.m1.1.1.5">𝑤</ci><ci id="algorithm2.13.13.m1.1.1.6.cmml" xref="algorithm2.13.13.m1.1.1.6">𝑒</ci><ci id="algorithm2.13.13.m1.1.1.7.cmml" xref="algorithm2.13.13.m1.1.1.7">𝑟</ci><ci id="algorithm2.13.13.m1.1.1.8.cmml" xref="algorithm2.13.13.m1.1.1.8">𝑠</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="algorithm2.13.13.m1.1c">answers</annotation></semantics></math>
</div>
<div id="algorithm2.13.22" class="ltx_listingline">

</div>
</div>
<figcaption class="ltx_caption"><span class="ltx_tag ltx_tag_float"><span id="algorithm2.15.1.1" class="ltx_text ltx_font_bold">Algorithm 2</span> </span>Question Answering Process for Large Tables</figcaption>
</figure>
<div class="ltx_pagination ltx_role_newpage"></div>
</section>
</section>
</article>
</div>
<div class="ar5iv-footer"><a href="/html/2407.09024" class="ar5iv-nav-button ar5iv-nav-button-prev">◄</a>
    <a class="ar5iv-home-button" href="/"><img height="40" alt="ar5iv homepage" src="/assets/ar5iv.png"></a>
    <a href="/feeling_lucky" class="ar5iv-text-button">Feeling<br>lucky?</a>
    <a href="/log/2407.09025" class="ar5iv-text-button ar5iv-severity-warning">Conversion<br>report</a>
    <a class="ar5iv-text-button" target="_blank" href="https://github.com/dginev/ar5iv/issues/new?template=improve-article--arxiv-id-.md&title=Improve+article+2407.09025">Report<br>an issue</a>
    <a href="https://arxiv.org/abs/2407.09025" class="ar5iv-text-button arxiv-ui-theme">View&nbsp;original<br>on&nbsp;arXiv</a><a href="/html/2407.09026" class="ar5iv-nav-button ar5iv-nav-button-next">►</a>
</div><footer class="ltx_page_footer">
<a class="ar5iv-toggle-color-scheme" href="javascript:toggleColorScheme()" title="Toggle ar5iv color scheme"><span class="color-scheme-icon"></span></a>
<a class="ar5iv-footer-button" href="https://arxiv.org/help/license" target="_blank">Copyright</a>
<a class="ar5iv-footer-button" href="https://arxiv.org/help/policies/privacy_policy" target="_blank">Privacy Policy</a>

<div class="ltx_page_logo">Generated  on Mon Aug  5 16:17:05 2024 by <a target="_blank" href="http://dlmf.nist.gov/LaTeXML/" class="ltx_LaTeXML_logo"><span style="letter-spacing:-0.2em; margin-right:0.1em;">L<span class="ltx_font_smallcaps" style="position:relative; bottom:2.2pt;">a</span>T<span class="ltx_font_smallcaps" style="font-size:120%;position:relative; bottom:-0.2ex;">e</span></span><span style="font-size:90%; position:relative; bottom:-0.2ex;">XML</span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQZLWTEaOUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAdpJREFUKM9tkL+L2nAARz9fPZNCKFapUn8kyI0e4iRHSR1Kb8ng0lJw6FYHFwv2LwhOpcWxTjeUunYqOmqd6hEoRDhtDWdA8ApRYsSUCDHNt5ul13vz4w0vWCgUnnEc975arX6ORqN3VqtVZbfbTQC4uEHANM3jSqXymFI6yWazP2KxWAXAL9zCUa1Wy2tXVxheKA9YNoR8Pt+aTqe4FVVVvz05O6MBhqUIBGk8Hn8HAOVy+T+XLJfLS4ZhTiRJgqIoVBRFIoric47jPnmeB1mW/9rr9ZpSSn3Lsmir1fJZlqWlUonKsvwWwD8ymc/nXwVBeLjf7xEKhdBut9Hr9WgmkyGEkJwsy5eHG5vN5g0AKIoCAEgkEkin0wQAfN9/cXPdheu6P33fBwB4ngcAcByHJpPJl+fn54mD3Gg0NrquXxeLRQAAwzAYj8cwTZPwPH9/sVg8PXweDAauqqr2cDjEer1GJBLBZDJBs9mE4zjwfZ85lAGg2+06hmGgXq+j3+/DsixYlgVN03a9Xu8jgCNCyIegIAgx13Vfd7vdu+FweG8YRkjXdWy329+dTgeSJD3ieZ7RNO0VAXAPwDEAO5VKndi2fWrb9jWl9Esul6PZbDY9Go1OZ7PZ9z/lyuD3OozU2wAAAABJRU5ErkJggg==" alt="Mascot Sammy"></a>
</div></footer>
</div>

    <script>
      var canMathML = typeof(MathMLElement) == "function";
      if (!canMathML) {
        var body = document.querySelector("body");
        body.firstElementChild.setAttribute('style', 'opacity: 0;');
        var loading = document.createElement("div");
        loading.setAttribute("id", "mathjax-loading-spinner");
        var message = document.createElement("div");
        message.setAttribute("id", "mathjax-loading-message");
        message.innerText = "Typesetting Equations...";
        body.prepend(loading);
        body.prepend(message);

        var el = document.createElement("script");
        el.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js";
        document.querySelector("head").appendChild(el);

        window.MathJax = {
          startup: {
            pageReady: () => {
              return MathJax.startup.defaultPageReady().then(() => {
                body.removeChild(loading);
                body.removeChild(message);
                body.firstElementChild.removeAttribute('style');
              }); } } };
      }
    </script>
    <script>
    // Auxiliary function, building the preview feature when
    // an inline citation is clicked
    function clicked_cite(e) {
      e.preventDefault();
      let cite = this.closest('.ltx_cite');
      let next = cite.nextSibling;
      if (next && next.nodeType == Node.ELEMENT_NODE && next.getAttribute('class') == "ar5iv-bibitem-preview") {
        next.remove();
        return; }
      // Before adding a preview modal,
      // cleanup older previews, in case they're still open
      document.querySelectorAll('span.ar5iv-bibitem-preview').forEach(function(node) {
        node.remove();
      })

      // Create the preview
      preview = document.createElement('span');
      preview.setAttribute('class','ar5iv-bibitem-preview');
      let target = document.getElementById(this.getAttribute('href').slice(1));
      target.childNodes.forEach(function (child) {
        preview.append(child.cloneNode(true));
      });
      let close_x = document.createElement('button');
      close_x.setAttribute("aria-label","Close modal for bibliography item preview");
      close_x.textContent = "×";
      close_x.setAttribute('class', 'ar5iv-button-close-preview');
      close_x.setAttribute('onclick','this.parentNode.remove()');
      preview.append(close_x);
      preview.querySelectorAll('.ltx_tag_bibitem').forEach(function(node) {
        node.remove();
      });
      cite.parentNode.insertBefore(preview, cite.nextSibling);
      return;
    }
    // Global Document initialization:
    // - assign the preview feature to all inline citation links
    document.querySelectorAll(".ltx_cite .ltx_ref").forEach(function (link) {
      link.addEventListener("click", clicked_cite);
    });
    </script>
    </body>
</html>

2407.09025
Spreadsheets are characterized by their extensive two-dimensional grids, flexible layouts, and varied formatting options, which pose significant challenges for large language models (LLMs) . In response, we introduceSpreadsheetLLM, pioneering an efficient encoding method designed to unleash and optimize LLMs’ powerful understanding and reasoning capability on spreadsheets. Initially, we propose a vanilla serialization approach that incorporates cell addresses, values, and formats. However, this approach was limited by LLMs’ token constraints, making it impractical for most applications. To tackle this challenge, we developSheetCompressor, an innovative encoding framework that compresses spreadsheets effectively for LLMs. It comprises three modules: structural-anchor-based compression, inverse index translation, and data-format-aware aggregation. It significantly improves performance in spreadsheet table detection task, outperforming the vanilla approach by 25.6% in GPT4’s in-context learning setting. Moreover, fine-tuned LLM withSheetCompressorhas an average compression ratio of 25×, but achieves a state-of-the-art 78.9% F1 score, surpassing the best existing models by 12.3%.
Finally, we propose Chain of Spreadsheet for downstream tasks of spreadsheet understanding and validate in a new and demanding spreadsheet QA task. We methodically leverage the inherent layout and structure of spreadsheets, demonstrating thatSpreadsheetLLMis highly effective across a variety of spreadsheet tasks.
abstract
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
Abstract
2407.09025
1IntroductionSpreadsheets are ubiquitous for data management and extensively utilized within platforms like Microsoft Excel and Google Sheets. Understanding spreadsheet layout and structure, a longstanding challenge for traditional models, is crucial for effective data analysis and intelligent user interaction. Recently, the rapid development of Large Language Models (LLMs)  has opened new frontiers in table processingand reasoning. However, spreadsheets pose unique challenges for LLMs due to their expansive grids that usually exceed the token limitations of popular LLMs, as well as their inherent two-dimensional layouts and structures, which are poorly suited to linear and sequential input. Furthermore, LLMs often struggle with spreadsheet-specific features such as cell addresses and formats, complicating their ability to effectively parse and utilize spreadsheet data, as detailed in AppendixA.In this paper, we introduceSpreadsheetLLM, a pioneering framework to unleash and maximize the potential of LLMs for spreadsheet understanding and reasoning.
We initially propose a vanilla encoding method to serialize spreadsheets into sequences, augmenting the Markdown encoding method by including essential cell addresses and (optional)  formats.
Furthermore, large spreadsheets that exceed the token limits of LLMs not only limit their processing but also, as observed in prior studies, degrade accuracy performance as the size increases. To address this challenge, we proposeSheetCompressor, featuring a novel encoding framework comprising three portable modules:1)  Structural Anchors for Efficient Layout Understanding:Observations indicate that large spreadsheets often contain numerous homogeneous rows or columns, which contribute minimally to understanding the layout and structure (see left panel in Figure2(a) ) . To address this, we identify structural anchors—heterogeneous rows and columns at possible table boundaries that offer substantial layout insights, as depicted in Figure2(b) . Then we remove distant, homogeneous rows and columns, producing a condensed "skeleton" version of the spreadsheet, as illustrated in Figure2(c) .2)  Inverted-Index Translation for Token Efficiency:The vanilla encoding method becomes token-consuming when handling spreadsheets with numerous empty cells and repetitive values, as shown in Figure2(c) . To improve efficiency, we depart from traditional row-by-row and column-by-column serialization and employ a lossless inverted-index translation in JSON format. This method creates a dictionary that indexes non-empty cell texts and merges addresses with identical text, optimizing token usage while preserving data integrity.3)  Data Format Aggregation for Numerical Cells:Adjacent numerical cells often share similar number formats. Recognizing that exact numerical values are less crucial for grasping spreadsheet structure, we extract number format strings and data types from these cells. Then adjacent cells with the same formats or types are clustered together. This method is visualized in the right example of Figure2, where rectangular regions are represented by uniform format strings and data types, streamlining the understanding of numerical data distribution without excessive token expenditure.We conducted a comprehensive evaluation of our method on a variety of LLMs. Our experiments show thatSheetCompressorsignificantly reduces token usage for spreadsheet encoding by 96%. Moreover,SpreadsheetLLMhas shown exceptional performance in spreadsheet table detection, the foundational task of spreadsheet understanding, surpassing the previous SOTA method by 12.3%. We also appliedSpreadsheetLLMto a representative spreadsheet QA task. Inspired by the Chain of Thought (CoT)  methodology, we propose Chain of Spreadsheet (CoS)  to decompose spreadsheet reasoning into a table detection-match-reasoning pipeline. It significantly outperformed existing SOTA methods for table QA.
Our primary contributions are summarized as follows:•We proposeSpreadsheetLLM, the first work that substantially leverage
LLMs for understanding and analyzing spreadsheet data. To address challenges in scale, diversity, and complexity of spreadsheets, we proposeSheetCompressor, an innovative encoding framework to compress spreadsheets for LLMs with efficient encoding.•We fine-tune a variety of cutting-edge LLMs to achieve optimal performance on spreadsheet table detection, and demonstrate the high effectiveness ofSpreadsheetLLMin accurately understanding complex spreadsheet layouts and structures.•In order to extend the horizontal capabilities ofSpreadsheetLLMto a wide range of downstream tasks, we propose CoS and verify it on Spreadsheet QA, highlighting its potential for intelligent user interaction.Figure 2:Illustration of theSheetCompressorframework. The original spreadsheet contains two tables, featuring numerous data entries or hierarchical headers, which can be viewed in the supplementary materials. The completed spreadsheet consists of 576 rows and 23 columns, with an vanilla encoding of 61,240 tokens. Initially, we first extract cells using structural anchors, rearranging them into a smaller 24×8 sheet. Subsequently, we perform index-invert, removing empty cells. Finally, we aggregate cells based one data formats, achieving an extremely compact representation of the spreadsheet, which contains only 708 tokens.
introduction
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
1Introduction
2407.09025
2Related WorkSpreadsheet RepresentationSpreadsheet representation involves converting the spreadsheets into specific representations for different models. There are various methods for spreadsheet (table)  representation.enhance Mask-RCNN to leverage spatial and visual information in spreadsheets, andexplores the usage of LLMs to evaluate image tables, but it doesn’t work well for spreadsheet images as input to VLMs. To capture sequential semantics in rows and columns, LSTMs are further adoptedin row&column directions. Pre-trained LMsare then proposed to understand spreadsheets. Recent studieshave explored the efficacy of using Markdown and HTML for table representation. However, they are not well suited to spreadsheets due to their single table input, as experiments show in AppendixB.Spreadsheet UnderstandingWhile most table LLMs are restricted to single table settings, spreadsheets with multiple tables typically exceed token limits. Moreover, the diversity in multi-table layout and structure significantly confounds the problem. Spreadsheet table detectionaims at identifying all tables on a given sheet and determining their respective ranges. As a fundamental task for spreadsheet understanding, this task triggers hundreds of millions of daily average usage in commercial spreadsheet tools, and the accuracy still urges improvements due to the flexibility and complexity of spreadsheets.Spreadsheet Downstream TasksSpreadsheet understanding is enabling for a series of spreadsheet tasks, such as table question answering analysis, table extraction, formula or code generation, error detection, etc. In this paper, we choose spreadsheet QA, one of the most demanded spreadsheet analysis tasks. It is an extension of the Table QA task in spreadsheet data, with the additional complexity of detecting and matching multiple tables within a spreadsheet.LLMs’ Token EfficiencyRelated work suggests that the performance of LLMs degrades significantly with long contexts. Efforts to improve model performance and reduce costs have led to the development of compression techniques for long prompts. Some researchers employ information-theory metrics to filter out redundant information. Additionally, specialized models have been proposed to optimize prompt compression. However, these strategies primarily address natural language prompts and may not suit tabular data, potentially leading to considerable structure and data information loss. DBCopilotenables text-to-SQL conversion on large databases through schema routing. However, due to LLMs’ insufficient ability in understanding inherent multi-table layouts and complex table structures that cannot execute queries similar to SQL, schema routing is impractical, restricting the broader application of cutting-edge tabular workson spreadsheet data.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
2Related Work
2407.09025
3MethodWe propose a novel spreadsheet encoding framework in a Markdown-like style as text. To achieve a more compact and efficient representation, we introduce three independent yet combinable modules: structural-anchor-based extraction, inverted-index translation, and data-format-aware aggregation, which enable efficient data compression and enhance performance on downstream tasks.3.1Vanilla Spreadsheet Encoding with Cell Value, Address, and FormatDue to the absence of standardized practices in spreadsheet encoding for LLMs, we first explore traditional spreadsheet encoding methods. AppendixBpresents a comparison of different mainstream tabular data encoding methods, including HTML, XML, and Markdown. Based on the encoding length and performance on spreadsheet understanding tasks, we use a Markdown-like style representation:(1) (2) wheredenotes the spreadsheet,denotes the text representation of a cell, and,,,respectively represent the row and column index of the cell and the row and column range of. We also explored the inclusion of cell format information (such as background color, bold font, borders, etc.)  into each cell’s representation. However, these experiments demonstrated that such detailed encoding adversely affects model performance due to rapid token limit exceedance and LLMs’ inadequate capability to process format information effectively, as detailed in AppendixA. We plan to further explore this in future research, focusing on enhancing the model’s ability to understand and utilize format and structural cues.3.2Structural-anchor-based ExtractionLarge spreadsheets often feature numerous homogeneous rows or columns, which minimally contribute to the understanding of their layout and structure, as depicted in Figure2(a) . To effectively compress spreadsheets while preserving vital layout and structural information, we propose a novel heuristic-based method, detailed further in AppendixC. This method identifies heterogeneous rows and columns at the edges of table boundaries—termed structural anchors:(3) whereand.
Using these anchor points, our method discards rows and columns that are located more thanunits away from any anchor point, because they rarely serve as table boundaries. The parameterserves as a threshold to control the scope of neighborhood retention, effectively eliminating areas predominantly filled with homogeneous data that do not contribute to an understanding of the spreadsheet’s layout and structure. We explored the effects of differentvalues in an ablation study, as detailed in AppendixD.1.The extracted rows and columns can be expressed as:(4) where the extracted "skeletons" are defined as:and.
Then we obtain the extracted compact spreadsheet:(5) Based on the compressed spreadsheet, we can obtain extremely shorter text representation.
Furthermore, after extraction, we perform a coordinate re-mapping to ensure continuity in cell coordinates, preserving the integrity of data relationships within the compressed spreadsheet. This re-mapping is critical for maintaining the accuracy of prediction results, ensuring that analyses remain consistent even after compression. This method filters out 75% spreadsheet content but preserves 97% rows and columns at the edges of table boundaries.3.3Inverted-index TranslationSpreadsheets often contain numerous empty rows, columns, and scattered cells. The standard encoding method, as detailed in Section3.1, employs a grid-based method that pairs cell addresses with their contents. This approach necessitates recording empty cells to maintain the spreadsheet’s two-dimensional structure, which significantly increases token consumption. Furthermore, cells with identical values are encoded repeatedly, further exacerbating token usage.To address these inefficiencies, we propose a two-stage Inverted-index-based Translation method. The first stage involves converting the traditional matrix-style encoding into a dictionary format, where cell values serve as keys indexing the addresses. In the second stage, cells sharing the same value are merged, with empty cells excluded and cell addresses noted as ranges. This method effectively reduces the number of required tokens by eliminating redundancies and simplifying the representation of repeated and empty cells. The translation process is represented mathematically as follows:(6) Inverted-index Translation is alossless compressionmethod general for all spreadsheet understanding tasks, and it remarkably increasesSheetCompressor’s compression ratio from 4.41 to 14.91. More details can be found in Table1.3.4Data-format-aware AggregationIn spreadsheets, adjacent cells typically share the same data format. As shown in Figure2(3) , column C records the sell-in billed revenue for different products. Nonetheless, the concrete numerical values are not essential for understanding the structure and semantics of the spreadsheet (although there might loss of fine-trained details of exact quantities, e.g., "18,476" and "18,674", this does not impact our comprehension that this column represents revenue) . In contrast, the data type is critical for understanding spreadsheets. On one hand, data types represent fundamental semantic properties, such as "time" or "phone number". It motivates us to implement rules to match the value of the cell to different data types. On the other hand, in contrast to detailed numerical values, identical data types may be compressed through clustering, thereby reducing the number of tokens.In this section, we introduce Data-format-aware Aggregation for further compression and information integration. Specifically, we employ Number Format String (NFS) , which is a built-in cell attribute in spreadsheets. NFSs can be extracted by default using tools like ClosedXML or OpenPyXL, used to describe the format of cell data as a string. For instance, the NFS for "2024.2.14" is "yyyy-mm-dd", indicating a specificdateformat. However, spreadsheet users do not always explicitly add NFSs to cells, so NFSs are sometimes absent. As a complement, we propose a rule-based recognizer to map a cell value to a specific predefined data type: Year, Integer, Float, Percentage, Scientific notation, Date, Time, Currency, Email, and Others. The first nine types broadly cover approximately 55% of the cells in our dataset derived from real-world corpora. Finally, based on the NFSs and data type, the aggregator aggregates the cells by Algorithm1.
This process can be represented as follows:(7) (8) wheredenotes the predefined rules as detailed above. In this way, we further reduce the number of tokens. The compression ratio of the data regions also increases from 14.91 to 24.79. More detailed compression effects of different modules are displayed in Table1.3.5Chain of SpreadsheetTo extend the applicability ofSpreadsheetLLMto a broader range of downstream tasks, we introduce the Chain of Spreadsheet (CoS) , which unfolds two stages:Table Identification and Boundary DetectionInitially, the compressed spreadsheet and the specific task query are input into the LLM. Leveraging the advances in spreadsheet table detection, the model identifies the table that is relevant to the query and determines the precise boundaries of the relevant content. This step ensures that only pertinent data is considered in the subsequent analysis, optimizing the processing efficiency and focus.Response GenerationThe query and the identified table section are re-input into the LLM. The model then processes this information to generate an accurate response to the query.Through the CoS,SpreadsheetLLMeffectively handles complex spreadsheets by breaking down the process into manageable parts, thus enabling precise and context-aware responses. In this paper, we validate the effect of the Spreadsheet QA task, which is detailed in Section4.2.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
3Method
2407.09025
4ExperimentsIn our experimental evaluation, we first verified the effectiveness of our method in spreadsheet understanding. For this purpose, we chose the classic and foundational task of spreadsheet table detection. This task serves as a critical benchmark for assessing the framework’s ability to accurately identify and interpret table structures within spreadsheets. Building upon this foundational understanding, we further explored the applicability of our method to downstream applications by selecting the representative task of spreadsheet QA. This allows us to test the model’s capability to not only detect but also comprehend and respond to user queries based on the data and structure identified in the spreadsheets.4.1Spreadsheet Table Detection4.1.1DatasetWe used the dataset introduced by, a benchmark dataset of real-world spreadsheets with annotated table boundaries. Due to the complexity and ambiguity of precise address labeling (the Fleiss Kappa on the test set is 0.830) , we further implemented the quality improvement pipeline on the test set by five human professions, as detailed n in AppendixE. To this end, we obtained a highly validated test set containing 188 spreadsheets. Based on the token usage of the vanilla encoding method, we divided the test set into four categories: Small, Medium, Large, and Huge, with a partition of 64:32:70:22. More details are shown in AppendixF. We adopted the Error-of-Boundary 0 (EoB-0)  metric for evaluation on 188 spreadsheets with 311 tables. EoB-0 requiresexact matchof the top, left, bottom, and right boundaries.4.1.2Experiment SetupBaseline & Evaluation MetricsTo evaluate the performance ofSpreadsheetLLM, we chose TableSense-CNNas the baseline due to its previously demonstrated effectiveness in spreadsheet table detection task. We employed the F1 Score as the primary metric to evaluate and compare the performance of different models, as it balances precision and recall, providing a holistic view of model accuracy.Model SelectionThe experiments included both closed-source and open-source models. From the closed-source spectrum, we selected two versions of OpenAI’s models: GPT4 and GPT3.5, which are known for their advanced language understanding capabilities. On the open-source side, we chose Llama2, Llama3, Phi3, and Mistral-v2. The specific configurations are detailed in AppendixG.4.2Spreadsheet QA4.2.1DatasetExisting datasets for the Table QA task focus solely on single-table scenarios, leaving a notable gap in performance evaluation for spreadsheets that contain multiple tables. To bridge this gap, we developed a new Spreadsheet QA dataset tailored to the complexities of multi-table environments. We sampled is better 64 spreadsheets from our larger collection and crafted 4-6 questions per spreadsheet, targeting fundamental operations such as searching, comparison, and basic arithmetic. We deliberately excluded questions involving composite operations to maintain clarity and focus in testing specific skills. Each question was paired with an answer, formatted either as a specific cell address or a formula that includes cell addresses, facilitating direct and unambiguous evaluations of the model’s ability to navigate and interpret spreadsheet data. This approach resulted in a comprehensive test dataset comprising 307 items, each a tuple of, which is detailed in AppendixH.Table 1:Average Compression Ratio on test datasets. Results of the train & valid set are shown in AppendixJ.1.MetricNo ModulesModule 1Module 2Module 3Module 1&2Module 1&3Module 2&3Module 1&2&3Total Tokens1,548,577350,946580,912213,890103,88096,365211,44562,469Compress Ratio1.004.412.677.2414.9116.077.3224.794.2.2Experiment SetupBaseline & Evaluation MetricsGiven that LLMs have not yet been systematically applied to Spreadsheet QA tasks, we have selectedTaPExand Binder, which are established baselines in the Table QA domain, for comparative evaluation. SinceTaPExand Binder are designed primarily for single-table data, we adapted them for our multi-table context. Initially, our fine-tuned model identifies table regions relevant to each question. These regions are then formatted and fed into the baseline models. In cases where the input exceeds the token limitations of the baseline models, truncation is employed. The accuracy of the answers is assessed based on the correctness of the cell addresses and cell combinations/calculations provided in the answers.Model SelectionOur experiments were conducted using the GPT4 model, leveraging its advanced capabilities in language understanding and reasoning. Details on parameters and configurations used are documented in AppendixG.4.2.3Experiment ProcedureIn this section, we employed the model fine-tuned on the spreadsheet table detection task to conduct QA experiments. The procedure followed the CoS described in section3.5. Particularly, for instances where the related table was still too large to process effectively, we applied further compression techniques. In cases where tables were exceptionally large and defy effective compression, we utilized a table-splitting algorithm designed to recognize headers and perform strategic concatenation, ensuring that each segment of the split table retains as much contextual integrity as possible. The specifics of this algorithm are detailed in AppendixM.2.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
4Experiments
2407.09025
5Results5.1Compression RatioThe effectiveness of our encoding process in reducing the size of spreadsheet data is quantitatively assessed using the compression ratio, which is defined by the formula:(9) Our encoding methodology has significantly optimized token usage within spreadsheets. In our test set, it achieved an impressive 25compression ratio, substantially reducing the computational load for processing large datasets. The specific compression ratios achieved by various module combinations withinSheetCompressorare detailed in Table1. These results highlight the efficacy of our approach across different configurations, demonstrating its robustness and adaptability in handling diverse spreadsheet structures.5.2Spreadsheet Table DetectionTable 2:Results of various Model & Method configurations on spreadsheet table detection. Our encoding method achievedSOTAon the GPT4 model.Model & MethodSmallMediumLargeHugeAllICLMistral-v20.0710.0130.0290.0170.036GPT40.3180.2920.0900.0000.154GPT4-compress0.4800.4540.3730.3300.410Fine-tuneLlama30.7150.7650.2900.0000.471Llama20.5570.3780.1070.0000.280Phi30.6040.4810.2010.1300.330Mistral-v20.7000.7840.4720.1230.542GPT40.7790.7070.2880.0000.520Llama3-compress0.8250.7680.6640.6170.719Llama2-compress0.7100.7220.6330.5780.660Phi3-compress0.8000.6730.6240.6750.689Mistral-v2-compress0.7780.7290.6860.7440.726GPT3.5-compress0.7950.6490.6000.6800.680GPT4-compress0.8100.8320.7180.6900.759-w/o Aggregation0.8640.8160.7390.7530.789TableSense-CNN0.7850.7880.5670.5610.6665.2.1Main ResultsTable2illustrates the performance differences among various models and methods on spreadsheet table detection task, and the detailed case study can refer to AppendixK.1)  Enhanced Performance with various LLMs:The fine-tuned GPT4 model achieved the F1 score of approximately 76% across all datasets, while our encoding method without aggregation achieved the F1 score of approximately 79% across all datasets. This marked a 27% improvement over the same model fine-tuned on original data, a 13% increase over TableSense-CNN, and established a newSOTA. The entire encoding method slightly reduced the F1 score within a tolerable range, but achieved good compression results, as shown in Table1. We also evaluated our encoding method on a series of open-source models. Notably, Llama3 and Mistral-v2 achieved an F1 score of approximately 72%, just 6 percentage points below the SOTA. The improvements due to our compression method were substantial, with increases of 25% for Llama3, 36% for Phi3, 38% for Llama2, and 18% for Mistral-v2. These results underscored the significant enhancement performance attributable to our encoding method.2)  Benefits for Larger Spreadsheets:Our compression method significantly boosted performance on larger spreadsheets, where the challenges were most pronounced due to model token limits. The improvements in F1 scores were particularly notable on huge spreadsheets (75% over GPT4, 19% over TableSense-CNN) , large spreadsheets (45% and 17%) , medium (13% and 5%) , and small (8%)  spreadsheets. This demonstrated our method’s effectiveness in enabling LLMs to process a broader range of spreadsheet sizes efficiently.3)  Improvements in In-Context Learning:Compact encoding also significantly enhanced ICL capabilities. For instance, the performance of GPT4 on all data improved by nearly 26%, demonstrating the method’s effectiveness beyond fine-tuned models to include ICL scenarios as well. More ICL results are shown in AppendixJ.2.4)  Significant Cost Reduction:Our cost was almost directly proportional to the input tokens, because the output table regions are short, which can be neglected. Based on the prices of the GPT4 and GPT3.5-turbo models111https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/in ICL, we reduced 96% cost in our test set. Detailed calculations are presented in AppendixI.5.2.2Ablation Experiment ResultsTable 3:Ablation studies on spreadsheet table detection.ModelSmallMediumLargeHugeAllGPT40.7790.7000.2880.0000.520GPT4-compress0.8100.8320.7180.6900.759-w/o Extraction0.8050.7720.6180.3210.655-w/o Translation0.7850.8040.7290.6360.743-w/o Aggregation0.8640.8160.7390.7530.789Table3presents the results of ablation experiments for different modules.
The removal of the extraction module led to significantly lower F1 scores, underscoring its critical role in capturing and retaining key structural information. As highlighted in Table1, this module also achieved the most significant token reduction, confirming its effectiveness. After removing the aggregation module, the F1 score slightly increased. This observation might be attributed to the NFS being more abstract than straightforward numerical representations, which can challenge an LLMs’ ability to interpret them effectively. Despite this, the NFS method offered a significantly high compression rate, enhancing its potential for practical applications and cost control.5.3Spreadsheet QATable 4:The results for Spreadsheet QA show that our method achieved SOTA. "-FT" means fine-tuned model on spreadsheet table detection task and is applied to QA.ModelAccuracyTaPEx0.378Binder0.622GPT40.466GPT4-compress-w/o splitting0.651GPT4-compress-w/o splitting-FT0.694GPT4-compress0.684GPT4-compress-FT0.743Table4shows the performance of various models on Spreadsheet QA tasks. We can draw the following conclusions:1)  Effectiveness of the CoS Method:The CoS method we developed significantly boosted the accuracy of models, showing a notable increase of 22% over the baseline GPT4 model. Given the large size of typical spreadsheets, directly inputting entire files often exceeded the token limits of conventional models. The CoS effectively addressed this issue by focusing only on regions relevant to the questions posed, thereby reducing redundant data and enabling more efficient handling of QA tasks on larger spreadsheets.2)  Generalization Capability of the Fine-tuned Model:The model that has been fine-tuned on the spreadsheet table detection task demonstrated robust generalization capabilities across downstream QA tasks. This fine-tuning led to an accuracy improvement of 6%. Moreover, it significantly outperformed theTaPExand Binder models by 37% and 12%, respectively. This substantial margin highlighted that fine-tuning not only prepared the model to better understand the specific data and structural nuances of spreadsheets but also enhanced its overall comprehension abilities.Table4also shows the influence of our designed split method on QA task performance. It can be seen that using the split algorithm improved accuracy by 3% and 5% on ICL and fine-tuning respectively. Therefore, LLMs can process some tables unable to be processed originally due to the token limitations, which enhances the performance ofSpreadsheetLLM.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
5Results
2407.09025
6ConclusionIn this paper, we proposed theSpreadsheetLLM, a novel framework representing a significant advancement in the processing and understanding of spreadsheet data by leveraging the capabilities of LLMs. Through a novel encoding method,SheetCompressor, this framework effectively addresses the challenges posed by the size, diversity, and complexity inherent in spreadsheets. It achieves a substantial reduction in token usage and computational costs, enabling practical applications on large datasets. The fine-tuning of various cutting-edge LLMs further enhances the performance of spreadsheet understanding. Moreover, Chain of Spreadsheet, the framework’s extension to spreadsheet downstream tasks illustrates its broad applicability and potential to transform spreadsheet data management and analysis, paving the way for more intelligent and efficient user interactions.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
6Conclusion
2407.09025
LimitationsWhile ourSpreadsheetLLMframeworks have markedly advanced how LLMs interpret and utilize spreadsheets, they also illuminate areas ripe for further research and development. Currently, our methods do not yet harness spreadsheet format details such as background color and borders, because they take too many tokens. However, these elements often contain valuable contextual and visual cues that could further refine our understanding and processing of spreadsheet data. Additionally, whileSheetCompressoreffectively aggregates data regions, it does not currently employ a sophisticated semantic-based compression method for cells containing natural language. For example, categorizing terms like "China," "America," and "France" under a unified label such as "Country" could not only increase the compression ratio but also deepen the semantic understanding of the data by LLMs. Exploring these advanced semantic compression techniques will be a key focus of our ongoing efforts to enhance the capabilities ofSpreadsheetLLM.
body
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
Limitations
2407.09025
Ethics StatementAll data were collected, analyzed, and reported without any bias or influence from external sources. The privacy and confidentiality of the participants were strictly maintained throughout the research process. No personal identifiers were used in the analysis or reporting of the data to ensure anonymity. At the same time, data standard personnel were paid according to the highest local standard, and their daily working hours were strictly limited to no more than 8 hours to protect their legitimate rights and interests.
We acknowledge the contributions of all individuals and institutions involved in this study and are committed to sharing our findings and methodologies transparently to facilitate further research and knowledge advancement in the field.
conclusion
SpreadsheetLLM: Encoding Spreadsheets for Large Language Models
Ethics Statement