Skip to content
English
  • There are no suggestions because the search field is empty.

Customizing Tables and Tabular Summaries with Advanced Prompting

In this article, you'll learn: 

  • How to supplement table examples with instructions on how to process source files
  • Prompting tips for troubleshooting table generations
  • Tips on when to build instructions into a template prompt vs. a refinement

Tips on Building a Table in Weave

A super tip:  Use the upcoming Better Tables feature to build tables with ease  

 

A step by step approach/logic to building a table.

 

1. Define the Output

  • Decide that a table is the desired format for your output.
    (This helps the AI structure data instead of producing free text.)
  • Select appropriate Data Tags

2. Specify the Structure

  • What is the structure of the table?
    → Should the data be organized primarily by rows or columns?
    → (Optional) How many columns or rows do you expect, 

     (e.g. create a table with  4 columns)?

3. Determine the Headers

  • Is the table’s composition fixed or flexible?
    → Should it include a specific list of headers (e.g., Parameter, Unit, Mean, SD)?
    → Should the AI infer headers from the data context (e.g. display all relevant content that was found)?

4. Define the Data Format

  • Should the data or headers follow a specific format?
    → Use examples: (e.g Dose vs. Dose (mg/kg/day), Body Weight (g)), or specify (provide values with 2 significant digits).
    → Mention any units, rounding, or display conventions.  

                          

5. Set the Granularity of Data

  • What level of detail should be shown?
    → Do you want summarized data (e.g., Organ Weight (g)) or more detailed data (Organ Weight (g), Organ-to-Body Weight Ratio (%), Organ-to-Brain Weight Ratio (%)).
    → If needed, provide examples or additional instructions to clarify expectations.

6. Define Order and Grouping

  • Does the data need to appear in a specific order or section layout?
    → For example:  Organize data by Primary Pharmacodynamics > Secondary Pharmacodynamics > Safety Pharmacodynamics > Pharmacodynamic Drug Interactions > Other.

→ Add an instruction to split the table into sections  Primary Pharmacodynamics, Secondary Pharmacodynamics and  Safety Pharmacodynamics. 

7. Additional Instructions

  • → Include any additional instructions for the table, (e.g. Use "-" if there is no data for a cell. Use "--" if there are no noteworthy findings. Include a list and definitions of any abbreviations used in the table caption. Include the same number ("*" or "**") of asterisks if present in the source data.)

How to build a simple table?

  • Copy and insert the exact table from the source material.

Prompt Example:

Recreate the “Schedule of Activities” table. If the table is split across multiple pages, combine all parts into a single table. Ensure the data is reproduced exactly as in the original.

  • Use a general short description of the table. 

Prompt Example:

Provide a brief description of the medical history and concurrent illnesses of the participants in narrative format. Insert the medical history and concurrent illnesses table, combining source tables if necessary.

  • Use a short and simple description of the table with some instructions.

Prompt Example:

Create a table with three columns to summarize the study population. List population descriptors (e.g. age, gender, etc.) in the first column, and present corresponding data for the control and patient groups in the second and third columns for clear comparison.


How to build a more complex table?

  • Include more detailed instructions into a prompt:

Prompt Example:


Guide

Prompt wording example


Instruct the AI to create a single table and specify how the table should be titled.

Generate a single table, titled: 'Pharmacology: Overview (Primary PD)'.

Specify how this table should look, including its overall structure and the specific columns to include.

Provide additional context for the values in each column if needed. For example, clarify what should appear under the Test System by adding an explanation in parentheses (e.g., dog, mouse, etc.).

Give the model clear instructions for cases where information is missing. For example, specify what to do if a Study Number cannot be found in the document, such as leaving the cell blank, inserting “NA”, or using alternative names if no data is available.

Include the following columns:

-Study Type (Primary Pharmacodynamics)

-Test System (e.g. mouse, dog, cell line)

-Method of Administration (type, time (day), dosage (mg/kg/day))

-Testing Facility (organization that generated or prepared the report)

-Study Number (if the Study Number is not available, use the first available alternative in this order: study report number, study #, study No, Study:, report #, document #)

Instruct the model to populate the table, ensuring that each study is assigned to its own individual row.

Create a row for each individual study and populate the table.

Add further instructions for the AI, such as how to handle missing data, how to create a list of abbreviations, and any other relevant guidance.

Use "-" if there is no data available. 

Use "- -" if there are no noteworthy findings. 

Include a list and definitions of any abbreviations used in the table caption. 

Include the same number ("*" or "**") of asterisks if present in the source data.


 

Advanced considerations and troubleshooting tips

Examples of complex tables include nested tables, tables providing extensive and diverse information drawn from large unstructured data, tables describing non straightforward conditions (e.g. mid study dose change, etc),  and others. 

  1. First, approach the creation of a complex table using general table-building logic. Some steps may require additional consideration, such as defining the structure, specifying the data outputs, and selecting the appropriate Data Tags.  


     
  2. Consider regenerating the table. Due to the nondeterministic nature of LLMs, a simple answer regeneration may sometimes “fix” the table.
  3. When creating the heading of the complex table, consider providing more explicit instructions. Consider clarity of logic and depth of prompt instructions when generating the structure of the heading. AI will do exactly what it’s told, not necessarily what you meant. When an AI has to infer or reason about details that aren’t explicitly stated, its conclusions may vary. Combined with the natural nondeterminism of LLMs, this can lead to results that are inconsistent or not fully aligned with your intent.
  4. For long large tables, consider splitting a large table into a few smaller tables to ensure optimal performance of the model within its context window.  
  5. Review source data, and ensure that the prompt is written in a way that accurately covers and reflects the types of data in the source material, so the AI can interpret and generate results correctly. If ambiguity is present, consider rewriting the prompt to better match the description of data in the source material. 

Prompt Example:

When the Study Number appears under different labels (e.g., “Study,” “Document Number,” or “Report Number”), provide this additional context to help the model interpret and extract the data correctly.

How large is the data source required to build that table? Should/could it be split into smaller sections (to optimize use of the LLM’s context window). How many documents are required to generate a table? Should some data tags be optimized to increase or decrease the number of included files? Should some files be removed during regeneration?

Example: 

Adding @upstream-processing or @downstream-processing data tags to manufacturing documents allows clarification of which part of the process the documents belong to.

How complex and clean is the source data? Are there replicate data points, similar names, or repeated experiments? Consider instructing the LLM to treat each file as unique. Provide the AI with additional clarification on how to handle such cases, e.g., should AI reason and make a random choice, prioritize one dataset over another based on date or recency, or treat each as independent?

 

Example: 

If the same data is found in multiple documents, return the data from the most recent document.

If the structure of the table headers is consistent, you may provide a table in Markdown as an example.

Prompt Example:

Create a single table using the following structure:

| Group Number | Group 1 | Group 1 | Group 2 | Group 2 | ... |
| Group Name| Control | Control | Low Dose (concentration) | Low Dose (concentration) | … |

| Dose | (dose) | (dose) | (dose) | (dose) | … | (If a dose change occurs, represent it as Dose 1-> Dose 2, including the day the change occurred and, if available, the number of days treatment was suspended. Separate male and female animal data into their respective columns, with male (M) first, followed by female (F))

| Gender | M | F | M | F | ... |

| Hematology Parameters at time point [t] | [blank cell] 

| [Additional rows for each hematology parameter, include all noteworthy observations] (Report only noteworthy findings, do not generate data if not available)

Include a list and definitions of any abbreviations used in the table caption.

Use "-" if there is no data for a cell.

Use "--" if there are no noteworthy findings.

Use +/-  for percent or fold increase/decrease.

For more complex issues or additional questions, please contact our team for further assistance. Use the upcoming Better Tables copy/paste table structure option to build tables!  


May I combine Tables and Text?

Tables and text can be combined within a single AI block. Create an AI Table block and include instructions for generating both text and a table.

Prompt Example:

Briefly summarize how the primary endpoint(s) used to determine efficacy were measured. If an efficacy threshold was defined in the protocol, this should be described. When there are multiple variables or when variables are measured repeatedly, the protocol should identify the primary ones with an explanation of why they were chosen, or designate the pattern of significant findings or other method of combining information that would be interpreted as supporting efficacy. Create a table summarizing the endpoint, measurement description and rationale for selection. 

How to transpose a table?

Sometimes, a generic description of a table may result in a layout that needs to be transposed. If the table has already been generated, you can use Refinement to request the table be transposed.

To avoid this, include specific instructions in the prompt to guide the original table design. 

Prompt Examples

Create a single table containing the following columns: A, B, and C.

Create a table with row titles D, E, F, and G in the first column, and use the remaining columns to display data for each individual patient population cohort.

How to split a table into sections?

  1. Include instructions to divide the table into sections.
  2. Specifying how each section should be arranged or prioritized.
  3. Define the order of sections to include, and add a statement to create a single unified table, outlining how to organize and label each section within it.

Prompt Example

Populate the table by creating individual sections for each Primary Pharmacodynamics, Secondary Pharmacodynamics, Safety Pharmacodynamics, Pharmacodynamic Drug Interactions, and Other (if applicable).