[GH-ISSUE #11623] issue: The last sentence will always be marked with a \boxed tag. #87040

Closed
opened 2026-05-15 11:22:43 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @etemical on GitHub (Mar 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/11623

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

0.5.20

Ollama Version (if applicable)

No response

Operating System

Ubuntu 22.04

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

Understood, when answering mathematical questions, the model should not include the trailing \boxed tag in the final sentence. For instance, instead of saying "9.9 is greater than 9.11"," it should simply state "9.9 is greater than 9.11." without the trailing \boxed tag.

Actual Behavior

However, the model's response ends with the display of \boxed 9.9 is greater than 9.11 on the webpage. I'm not sure what the purpose of the \boxed tag is, and why it is included every time.

Steps to Reproduce

Select a LLM model, then ask the model which is greater between 9.9 and 9.11, and you will find that the issue: the webpage displays the final answer with a \boxed tag.

Logs & Screenshots

Image

Additional Information

No response

Originally created by @etemical on GitHub (Mar 13, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/11623 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version 0.5.20 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 22.04 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior Understood, when answering mathematical questions, the model should not include the trailing `\boxed` tag in the final sentence. For instance, instead of saying "9.9 is greater than 9.11"," it should simply state "9.9 is greater than 9.11." without the trailing `\boxed` tag. ### Actual Behavior However, the model's response ends with the display of `\boxed 9.9 is greater than 9.11` on the webpage. I'm not sure what the purpose of the `\boxed` tag is, and why it is included every time. ### Steps to Reproduce Select a LLM model, then ask the model which is greater between 9.9 and 9.11, and you will find that the issue: the webpage displays the final answer with a `\boxed` tag. ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/f2893cd8-f4a4-4cdb-932a-3dec0291401a) ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-15 11:22:43 -05:00
Author
Owner

@ArianDJ commented on GitHub (Mar 13, 2025):

Cause

  • Model Behavior: Many LLMs (especially math-focused ones) are trained to highlight final answers using LaTeX's \boxed{} syntax. The model may append this tag automatically when it detects a numerical or comparative answer.
  • LaTeX Rendering: Open WebUI does not currently render LaTeX syntax by default, so raw tags like \boxed appear as plain text in the response.

Solutions

  • Modify Open WebUI to strip LaTeX formatting for non-math contexts, or
  • Adjust the model's behavior via the system prompt to avoid using \boxed.

Recommended Fix (immediate workaround):
Update the system prompt template in Open WebUI to explicitly instruct the model to avoid using LaTeX formatting. For example:

SYSTEM_PROMPT = """\
You are a helpful assistant. Format answers clearly and avoid LaTeX or special markup like \boxed. Use plain text only.
"""
<!-- gh-comment-id:2720657914 --> @ArianDJ commented on GitHub (Mar 13, 2025): **Cause** - Model Behavior: Many LLMs (especially math-focused ones) are trained to highlight final answers using LaTeX's \boxed{} syntax. The model may append this tag automatically when it detects a numerical or comparative answer. - LaTeX Rendering: Open WebUI does not currently render LaTeX syntax by default, so raw tags like \boxed appear as plain text in the response. **Solutions** - Modify Open WebUI to strip LaTeX formatting for non-math contexts, or - Adjust the model's behavior via the system prompt to avoid using \boxed. Recommended Fix (immediate workaround): Update the system prompt template in Open WebUI to explicitly instruct the model to avoid using LaTeX formatting. For example: ``` SYSTEM_PROMPT = """\ You are a helpful assistant. Format answers clearly and avoid LaTeX or special markup like \boxed. Use plain text only. """ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#87040