Gemini 2.5 Pro and Flash break when working with long tables

When generating markdown tables with expected long content, the AI will generate the dash line that signifies the header line. If this is very long, the AI gets stuck at generating the dashes and eventually starts returning random content. By removing the excessive dashes in previous messages (which are not necessary for MD display), the AI can continue to use this shorter pattern and run in a stable format.

Example:

| Parameter                                                     | Rationale / Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Specification / Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| :------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Anticipated Planning Horizon / Design Cycle for the EUC**   | The EUC serves a dynamic research and development environment within a startup. Design iterations and significant modifications are expected based on evolving research needs and resource availability. Therefore, defining a long-term fixed lifespan is unrealistic. A shorter planning horizon reflects the intended development cycle. A significant modification that impacts the safety concept would necessitate a re-evaluation of the risk assessment and potentially constitute a "new machine" from a conformity assessment perspective, resetting this horizon.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | The current design iteration and this risk assessment are based on an anticipated operational and development timeframe of approximately **2 years**. Future major redesigns or modifications will require a review and update of this risk assessment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

maybe the model can be finetuned to generate a maximum of 20 dashes

4 Likes

Yeah, I’m facing the same issue with Flash 2.0 also. I’ve tried lowering the temperature, but it did not improve the situation.

1 Like

Hey folks, Thanks for flagging.

If you could provide the prompt if possible that will be helpful to repro the issue.

Getting this constantly. I notice you also picked Github Flavored Markdown. Even when I drop the requirement for GFM… any multi-page table just DESTROYs Gemini. MAX_TOKENS errors all day long no matter what the model is.

This is the main blocker to all my chunking work. Massive issue with Gemini.

Here:

You are an expert at extracting large tables from documents.
You will be given a document and you will need to extract all the large tables from the document.
You will need to create a table with appropriate headers and column names.
Then fill in the table 'cells' with the data from the document.
Only include tables that span more than one page.

Doesn’t matter if I use examples or not, doesn’t matter if the prompt is long and detailed or short and vague (like this one, above).

Doesn’t matter if it’s structured content or just text mime type response. Just cursed. Completely cursed. Amazed you don’t know about this. Must be thousands of people out there with this exact issue.

1 Like