Chapter 3 10 min read

LLM-Focused Formatting

LLM-Focused Formatting is a score (0-100) that assesses the degree to which a webpage employs specific HTML structural elements that facilitate easy parsing, extraction, and synthesis by Large Language Models.

LLMs are optimized to process content that is logically segmented and clearly delineated. Formats like bulleted lists, numbered steps, tables, and concise summaries serve as explicit signposts, allowing the model to identify and isolate key pieces of information efficiently. Content with strong LLM-focused formatting is more likely to be accurately interpreted and featured in AI-generated answers, as its structure aligns with the model's data processing capabilities.

Calculation Methodology

The score is a weighted average of three components: structural element density, heading quality, and content conciseness.

Structural Element Density (40% weight)

This measures the frequency of structured elements relative to the total word count.

  • Count the total number of <ul>, <ol>, and <table> tags.
  • Count the total number of <li> tags within lists.
  • Normalize these counts against the page’s word count (e.g., number of lists per 1000 words).

Heading Quality (30% weight)

This assesses the clarity and logical structure of headings.

  • Analyze <h2> and <h3> tags to check if they are phrased as questions (e.g., “What is…”, “How to…”), which is often a positive signal.
  • Verify that the heading hierarchy is logical (e.g., <h3> tags are nested under <h2> tags).

Content Conciseness (30% weight)

This evaluates the readability and scannability of the text.

  • Calculate the average number of sentences per paragraph. Shorter paragraphs are easier to parse.
  • Scan for the presence of summary elements like “Key Takeaways” or “TL;DR” sections.
  • Measure the frequency of bolding (<strong> or <b> tags) used to highlight key terms.

Calculating The LLM-Focused Formatting Score

The calculation of the LLM-Focused Formatting Score is a multi-step process that involves analyzing the HTML structure of the page. Here is a simplified pseudo-code representation of how this score is calculated.

Pseudo-code for LLM-Focused Formatting Score Calculation

BEGIN
 FETCH and PARSE the webpage content.
 EXTRACT main content area and calculate word_count.

 // Calculate Structural Element Density
 COUNT <ul>, <ol>, <table>, and <li> tags.
 NORMALIZE count against word_count.
 COMPUTE density_score.

 // Calculate Heading Quality
 ANALYZE <h2>/<h3> tags for question-based phrasing.
 VERIFY logical heading hierarchy (h3 under h2, etc.).
 COMPUTE heading_quality_score.

 // Calculate Content Conciseness
 CALCULATE average sentences per paragraph.
 SCAN for summary elements ("Key Takeaways", "TL;DR").
 MEASURE frequency of <strong>/<b> tags.
 COMPUTE conciseness_score.

 CALCULATE final_score as the weighted average of the three components.
 RETURN final_score.
END

Conclusion

By focusing on LLM-Focused Formatting, you are making your content more accessible and understandable to AI systems. This will increase the chances of your content being used in AI-generated answers, and it will also improve the user experience for your human readers.

Key Takeaways

  • LLM-Focused Formatting is crucial for AI-readiness.
  • The score is based on structural element density, heading quality, and content conciseness.
  • Use of lists, tables, and clear headings is important.
  • Short paragraphs and summary elements improve readability for both humans and AI.