Seunghyeon Ji
#LLM #Study note #AI-generated

Coxwave AgentX team's edutap product provides a variety of content for learners.

Among them, study notes are summaries that allow learners to review key lecture content alongside illustrations at a glance. They are designed to help learners review quickly before and after taking a lecture.

However, layouts often broke in the study notes. Text spilled out of illustrations, arrows overlapped with text, and texts overlapped with each other, making them difficult to read. In this article, we would like to introduce the visual defect issues in study notes and the process of resolving them.


Study notes are drawn directly by an LLM

Instead of generating images with a diffusion model, study notes are created in HTML format by an LLM (Large Language Model) using lecture data. As a result, text like Korean characters does not break, interactive features such as clicking buttons can be provided, and, if necessary, only parts of the generated study notes can be modified.

This is a portion of a study note generated by an LLM. It explains how appetite-suppressing signals and food rewards function in the brain. However, there is a visually untidy part here.

The text “Leptin signal” sits directly on top of the arrow going from fat cells to the brain, making it hard to read. This phenomenon occurs because the LLM writes coordinates as numbers when creating HTML.

The text is written at position (270, 137) with a font size of 17, and the arrow is written as a curve starting at (218, 168). However, just by looking at the source code, there is no way to know where "Leptin signal" actually starts and ends on the screen, or at what height the curve crosses the text area. These values can only be known after the font is determined and the curve is calculated, which is the job of the browser's rendering engine.

To eliminate these problems, we decided to introduce a process that automatically detects defects after generation. First, we considered having a VLM (Vision Language Model) look at the study notes. However, while the VLM did not miss defects, it frequently reported defects even when there were none. Furthermore, it could give different answers each time for the exact same screen, and it could not quantitatively explain why something was a defect.

So we changed our approach. Since layout defects are ultimately the result of calculations made by the browser, we decided to ask the browser directly for the coordinates. We render the study notes in an actual browser and then check whether text, lines, and shapes overlap based on the positions calculated by the browser. This allows us to know precisely where and by how much the "Leptin signal" text overlaps with the arrow in the image above.


Defining the types of defects

Simply saying "it doesn't look visually clean" or "the layout is broken" is too abstract. To detect defects, we first needed to define what constitutes a defect. Referring to the classification in ReDeCheck (ISSTA 2017), a study on web layout defects, we categorized the defects that actually occur in study notes into 7 types.

Element Collision

  1. This is when text overlaps with a line or an arrow. "Leptin signal" overlaps with an arrow, hindering readability.


  2. This is when text crosses the boundary of a shape. "Multiple regions regulate" is longer than the Brain shape, so both ends stick out beyond the shape, and the shape's border passes over the text.


  3. This is when texts overlap with each other. "Eating → dopamine rises" is layered on top of the heading below, "Food seeking, reward, reinforcement", making both sentences difficult to read.

Element Protrusion

  1. This is when text longer than its box is cut off and hidden. Because the height of the area containing the bottom three lines is fixed, the last line, "Reward also drives eating after fullness", is cut off at the boundary, showing only its upper half.


  2. This is when text spills out of a colored box. The width of the "Reward from tasty food" button is narrower than the text, causing the trailing "tasty food" to stick out past the button's border.

Viewport Protrusion

  1. This is when content extends outside the SVG canvas and gets clipped. The dashed lines on either side represent the boundaries of the SVG canvas. Because "e.g. desserts, milkshakes" extends past the right boundary, that part is not rendered even though there is empty space outside the dashed line, getting cut off at "milksha".


  2. This is when horizontal scrolling occurs across the entire page. The diagram is drawn wider than the screen width, pushing the right side out of view and creating a horizontal scrollbar at the bottom of the page. The learner has to scroll horizontally to see the content on the "Response to eating" and "Tasty food" sides.


Just as important as identifying defects was defining what is not a defect. If non-defective parts are flagged as defects, the LLM will touch study notes that don't need fixing, potentially making them worse. Therefore, we decided not to treat the following cases as defects.


Elements briefly overlapping during animation

These are elements that temporarily overlap during an animation. The "Market equilibrium" label has an animation where it starts on top of the arrow and moves upward, so measuring it immediately after rendering shows it overlapping with the arrow. However, since it no longer overlaps once settled in place, it is not a defect.

Text straddling the boundary of a semi-transparent shape

This is text straddling the boundary of a semi-transparent shape. "Data science" is positioned where three circles overlap, so the border of a circle passes through the text. However, Venn diagrams are intended to have overlapping semi-transparent circles, and the text beneath the border remains legible, so this is not a defect.


Detected by the browser, fixed by the LLM

Now, we set out to automatically detect the defined defects. Instead of using an LLM for detection, we render the study notes in an actual browser at a desktop standard width of 1280px and make determinations solely based on the coordinates calculated by the browser. Thanks to this, verifying the same study note multiple times yields consistent results, and we can explain why something is a defect using numbers—for example, "The 'Leptin signal' text overlaps with the arrow by 115x8px."

The principle is simple: after finding the positions of all visible text, lines, and shapes on the screen, we check whether they match any of the 7 defined defect types.

These are the text bounding boxes, points along lines, and shape bounding boxes calculated by the browser. Multiple points along the arrow fall within the text bounding box of "Leptin signal", leading to the determination that text overlapping with an arrow is a defect.

Now that the defect has been identified, it needs to be fixed. The easiest way is to regenerate the entire study note. However, regenerating it from scratch changes not only the layout but the entire body text, and can introduce other defects. Therefore, we decided to ask the LLM to fix only the defective portion. The repair process proceeds in the following steps.


  1. Extract only the HTML snippet of the part to be fixed.

    "Leptin signal" overlapped with an arrow inside an SVG diagram. Therefore, we designate this entire SVG as the part to fix and extract only the SVG's HTML, rather than the entire study note. The smaller the snippet, the less room there is for the LLM to alter unrelated parts.


  2. Provide the snippet along with the defect reason to the LLM.

    We feed the browser's exact measurement results directly into the prompt. Instead of saying "it looks like it overlaps with the arrow a bit," we inform it that "'Leptin signal' overlaps with the arrow by 115x8px," eliminating the need for the LLM to guess what needs to be moved and where.


  3. Verify the snippet modified by the LLM.

    The LLM moved "Leptin signal" above the arrow by merely changing its coordinates. However, we do not blindly trust the result. First, we verify whether the original text is preserved and whether the snippet has become excessively large. Then, we substitute the snippet back into the study note and measure it again with the browser. In this example, the defect count decreased from 1 to 0, so the revised version was adopted. If the defects had remained unchanged or increased, it would have been reverted to the original, ensuring that study notes made worse than before the revision are never saved.


Results

When study notes were initially generated, the defect rate was 23%; currently, it stands at 3%. The remaining 3% is due to study notes where fixes failed. If a revision fails to reduce defects, the original is retained as is, and the remaining defects are logged.

However, there are still limitations.

  1. Only a single desktop width (1280px) is verified. Validating across multiple screen widths would multiply the verification time for a single study note by the number of widths. Since study notes are mainly viewed alongside lectures on desktop screens, we currently only account for a 1280px screen.

  2. If a fix fails, the defect remains. While the study note does not become worse because the original is kept, the defect is left unresolved.


Conclusion

Merely evaluating the text of an LLM-generated study note was insufficient to understand how it would appear on the screen. Therefore, we delegated the judgment to the browser. By finding defects using coordinates calculated by the browser, verifying the same study note multiple times consistently yielded identical results, and we could explain why something was a defect using numbers. Moving forward, we plan to validate across a wider range of screen widths, including mobile, and explore ways to re-attempt fixes for defects that initially failed to resolve.

2026 Coxwave. All rights reserved.

powered by

2026 Coxwave. All rights reserved.

powered by

2026 Coxwave. All rights reserved.

powered by

2026 Coxwave. All rights reserved.

powered by