AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Kimi Handles Multi-Column Scanned PDFs Without Destroying Table Structures

劉書磊 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Feeding a scanned, two-column equity research report or a dense financial audit document into an AI parser is usually a recipe for chaos. Standard parsers read across the page horizontally, merging the left column with the right column and slicing through tables like a paper shredder. Numbers drift into adjacent narrative text, merged headers collapse, and balance sheet columns shift without warning.

Kimi, developed by Moonshot AI, tackles this problem through a hybrid pipeline combining visual Document Layout Analysis (DLA), Optical Character Recognition (OCR), and Table Structure Recognition (TSR) before feeding the parsed stream into its massive context window. At 365Finds, we put Kimi's document handling to the test across complex multi-column layouts, financial statements, and scanned workpapers. The system demonstrates exceptional resilience against layout scrambling, but it also carries distinct blind spots that auditors and analysts must manage proactively.


The Core Problem: Why Scanned Multi-Column Tables Break

Understanding how Kimi protects table structures requires examining what makes scanned, multi-column PDFs fail in conventional tools.

A digital PDF contains text vectors and positioning coordinates. A scanned PDF contains nothing but raw pixels. When a naive optical extraction engine processes a multi-column page, it commits two catastrophic layout errors:

  1. The Zigzag Reading Order Failure: The parser scans line-by-line along the horizontal axis ($Y$-coordinate). Instead of reading down Column 1 and then starting at the top of Column 2, it alternates between them: Line 1 of Column 1 merges with Line 1 of Column 2.
  2. Table Boundary Collisions: If a table sits inside Column 1, horizontal scanning pulls Column 2 narrative text straight into table rows. Conversely, if a table spans across both columns (a wide financial statement), an aggressive column splitter will slice the table in half down the middle, separating account names from their numerical values.
Naive Parsing (Zigzag Collapse):
[Left Col: Revenue rose 12%] ---> [Right Col: Operating expenses] ---> [Merged Gibberish]

Kimi Layout Analysis (Segmented):
[Block 1: Left Col Flow]   ===> Processed independently
[Block 2: Spanning Table]   ===> Isolated in bounding box, converted to grid
[Block 3: Right Col Flow]  ===> Processed independently

How Kimi Reconstructs Multi-Column Layouts and Tables

Kimi does not treat uploaded documents as flat OCR text streams. In both the consumer web interface and the Moonshot Files API (purpose="file-extract"), the engine routes documents through a structured parsing architecture.

1. Visual Layout Segmentation (DLA)

Before reading characters, Kimi's vision pipeline divides the scanned page into distinct bounding boxes:

By identifying the column gutters through projection and edge detection, Kimi isolates Column 1 from Column 2. More importantly, when it detects a table boundary, it quarantines that rectangular area from the narrative text flow. Narrative reading order halts above the table and resumes below it, preventing surrounding analysis from bleeding into numeric rows.

2. Table Structure Recognition (TSR)

Once a table area is quarantined, Kimi's table engine maps its internal coordinate grid:

3. Markdown Normalization and Context Ingestion

The extracted table is transformed into standard Markdown table syntax (| Col 1 | Col 2 |) or structured JSON. This clean representation is then inserted into the model's prompt alongside the ordered text stream. Moonshot's large context window (handling up to 1 million tokens in flagship models like kimi-k3 and kimi-k3.1-pro) allows the model to retain full document context, cross-referencing footnotes with table line items without truncation.


Where Kimi Excels—and What Concerns 365Finds

At 365Finds, we appreciate Kimi's handling of dual-column analyst reports, bilingual Chinese-English research papers, and standard corporate filings. Compared to basic OCR wrappers, Kimi rarely scrambles parallel text columns, and its ability to turn scanned research tables into workable Markdown without manual regex cleaning is genuinely impressive.

However, complex financial audits and working papers expose real vulnerabilities. We do not recommend blind trust in Kimi's table extractions for mission-critical accounting. Here is what causes friction:

Document ScenarioKimi's Performance365Finds Assessment & Risk Level
Standard Dual-Column Research ReportsClean column separation; figures and narrative remain intact.Low Risk: Highly reliable for rapid synthesis and summaries.
Wide Tables Spanning Multiple ColumnsAccurately recognized as full-width elements; avoids splitting.Low to Moderate Risk: Verify that footnote callouts do not append to numbers.
Borderless Financial Footnote TablesNumbers can occasionally shift one column to the left or right.High Risk: Missing vertical borders cause silent column slippage.
Multi-Page Spanning StatementsHeader context can degrade on pages 2 and 3 if headers do not repeat.Moderate to High Risk: Requires explicit multi-page prompt anchoring.
Skewed, Low-DPI, or Camera-Photographed ScansPerspective distortion warps grid lines, causing cell mergers.Critical Risk: Must be deskewed before processing.
Corporate Seals and Stamp OverlaysRed stamp ink over financial figures causes digit misreads.Critical Risk: Digits like 8 and 3 or 0 and 6 can swap silently.

The most dangerous failure mode is not an obvious error—it is the silent column shift. In borderless accounting tables, if Kimi misjudges a whitespace gap, a number belonging to "2024 (Restated)" can slide into "2024 (Reported)". The Markdown table still looks structurally perfect, but the financial data is corrupt.


Practical Playbook: Extracting Scanned Tables with Maximum Fidelity

To get clean, uncorrupted table extractions from complex multi-column scans in Kimi, follow this operational workflow.

Step 1: Pre-Upload File Preparation

Step 2: Target the Extraction Scope via Prompting

Never ask Kimi to "read this document and extract all tables." Broad instructions invite compression and summarization shortcuts. Instead, isolate the target pages and enforce structural rules:

Please locate the financial tables on pages 14 through 16 of the uploaded scanned PDF. 
This document has a two-column layout with a full-width spanning balance sheet.

Requirements:
1. Extract the table exactly as formatted, outputting it as a Markdown table.
2. Maintain strict column counts for every row. Do not merge adjacent columns.
3. For empty or null cells, explicitly insert "-" or "[Empty]". Do not shift numbers to the left.
4. If a digit is partially obscured by a stamp or watermark, output "[Unreadable]" instead of guessing.
5. Provide a separate list of any table footnotes that reference specific row items.

Step 3: API Pipeline for Automated Processing

If automating through the Moonshot AI platform, use the official file-extraction workflow:

import os
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("MOONSHOT_API_KEY"),
    base_url="https://api.moonshot.ai/v1",
)

# 1. Upload scanned PDF for layout extraction
file_obj = client.files.create(
    file=Path("audit_report_scanned.pdf"),
    purpose="file-extract",
)

# 2. Retrieve the parsed Markdown layout text directly
extracted_markdown = client.files.content(file_id=file_obj.id).text

# 3. Prompt the model to validate and extract structured table data
response = client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[
        {
            "role": "system",
            "content": "You are a senior financial data auditor. Extract and audit tabular data with zero tolerance for column displacement."
        },
        {
            "role": "user",
            "content": f"Here is the parsed document content:\n\n{extracted_markdown}\n\nExtract the Consolidated Statement of Cash Flows into a clean CSV format."
        }
    ],
    temperature=0.0,
)

print(response.choices[0].message.content)

Setting temperature=0.0 is essential. It minimizes creative variance and forces the model to adhere strictly to the extracted tokens.


The 365Finds Verification Protocol: Never Trust Without a Checksum

When working with financial filings, analyst models, or audit workpapers, extraction is only half the job. At 365Finds, we apply a mandatory three-point verification check to any table extracted by Kimi:

  1. Row Delimiter Consistency Check: Verify that every row in the generated Markdown table contains an identical number of pipe characters (|). A missing pipe means a cell collapsed into its neighbor.
  2. Mathematical Checksum Validation: Pick three subtotal rows (such as Total Current Assets, Total Liabilities, and Gross Profit) and calculate the sum of their component rows in an external sheet. If the sum does not match Kimi's extracted subtotal, a column shift or digit OCR error occurred.
  3. Negative Number and Currency Symbol Audit: Check whether negative numbers indicated by parentheses, such as (4,250), were preserved or converted erroneously to positive values.

Kimi is currently among the most capable tools available for parsing messy, multi-column Chinese and English research reports. Its visual layout analysis successfully protects table geometry from the reading-order chaos that cripples simpler LLM tools. But when the borders disappear and the audit stamps overlap the balance sheet, manual checksums remain your only reliable defense against silent data corruption.

References