An AI server inside the medical center

We are installing a local artificial intelligence server in a medical center. Patient images and records stay in the building. The model we chose, Qwen3.8-Flash-Next, is an open model that reads text and images, and it runs on two of the server’s graphics cards.

Component Configuration
Server Virtual machine, 16 virtual CPUs, 128 GB of RAM
Graphics cards 2 × AMD Radeon R9700 with 32 GB, driven by ROCm 7.2.4
Model Qwen3.8-Flash-Next, a 176-billion-parameter “Mixture of Experts” model, text and images
Deployed version Quantized to Q4_K_M (94.5 GB), split across both cards
Context About 65,000 tokens, two requests processed in parallel
Inference engine llama.cpp (llama-server), in a modified version that adds multi-token prediction (MTP)
Generation speed 53 to 62 tokens per second

Before connecting the model to any clinical use, we test it on tasks where we know the answer. One of them is saying which eye a fundus photograph shows. For an ophthalmologist, this is immediate: the optic disc, the bright spot the vessels radiate from, lies on the side of the nose. On a fundus photograph taken from the front, a disc in the left half of the image therefore indicates a left eye.

We gave the model a normal fundus photograph of a left eye and asked it to describe it and state the laterality. It answered “right eye”. Its description of the image was accurate: optic disc cupping, temporal scleral crescent, vascular arcades. Its justification was not: “The optic disc is located on the left of the image and the macula in the center-right. Since the nasal pole is therefore on the left, this is a right eye (classic rule: disc on the left = OD; disc on the right = OS).”

The model found the disc in the right place and quoted a reversed rule. Increasing the image resolution changed nothing. A system message stating the correct convention made it answer “left eye”.

The protocol

A single image proves nothing. We took 30 fundus photographs from the public IDRiD dataset, 15 right eyes and 15 left eyes spread across the whole test set, 20 of which show diabetic retinopathy. For each one, the dataset’s authors provide the position of the optic disc and the fovea as marked by experts, which gives the laterality without ambiguity. We added the mirror image of each photograph, which turns a right eye into a left eye. That makes 60 images, with as many right eyes as left eyes. Figure 1 shows one of these pairs.

Two fundus photographs side by side: on the left, the original photograph IDRiD_056, a right eye with the optic disc ringed in the right half of the image; on the right, the same photograph as a mirror image, with the optic disc in the left half. Under each one, the actual eye and Qwen3.8-Flash-Next's answer.
Figure 1. On the original photograph, a right eye, Qwen3.8-Flash-Next answers left eye. On the mirror image, a left eye, it answers right eye. Photograph IDRiD_056 (Porwal et al., CC BY 4.0), resized and annotated by us.

Each image received three questions, asked in English. Each one offers two answers, labeled A and B, and the model must reply with a single letter.

No. Question put to the model Possible answers
1 In which half of the image is the optic disc (optic nerve head)? Left half of the image
Right half of the image
2 Which eye is shown in this fundus photograph? Right eye (OD)
Left eye (OS)
3 Question 2, followed by the convention below The same as in question 2

The convention added to question 3 is the anatomical rule given above. Here is the text sent to the model:

Convention: the photograph is oriented as seen by an examiner
facing the patient, and the optic disc lies on the nasal side
of the macula. Hence a disc in the left half of the image means
a LEFT eye, a disc in the right half means a RIGHT eye.

In other words, the photograph is seen by an examiner facing the patient, the optic disc is on the side of the nose, and a disc in the left half therefore indicates a left eye.

The model does not write an answer. We use SemIf, an open replica of Jev, TypeSafe AI’s decision model. We introduced it in our article on decision models. SemIf reads the probability the model assigns to the letter A and to the letter B.

A language model may prefer answer A, whatever it says. To measure this preference and then remove it, each question was asked twice, with the answers swapped: once with Right eye (OD) as A and Left eye (OS) as B, once with Left eye (OS) as A and Right eye (OD) as B. For each image, we then average the two probabilities obtained for each answer, and we keep the answer whose average is above 0.5. In total, 360 decisions (60 images, 3 questions, 2 versions of the answers), without a single technical error.

The path of one image
  1. a fundus photographor its mirror image
  2. three questionsdisc, eye, eye with the convention
  3. swapped answersright eye as A, then left eye as A
  4. average over both versionsprobability of each answer
  5. answer keptcompared with the IDRiD ground truth

The results

Figure 2 gives the share of correct answers. Question 2 appears twice: with the raw answers, then with the answer options swapped, which removes the preference for answer A.

Horizontal bar chart. Where is the optic disc: 100%. Which eye, raw answers: 48%. Which eye, answer options swapped: 15%. Which eye, optic disc rule given: 100%. A marker shows chance at 50%.
Figure 2. The model always locates the optic disc (question 1). On question 2, its raw answers mostly follow the letter A; once this preference is removed, it gives the right eye far less often than chance. Giving the rule fixes every image (question 3).
Question Result
1. Position of the optic disc 120 correct decisions out of 120, median probability 0.95
2. Which eye, raw answers 58 correct decisions out of 120, answer A chosen 118 times out of 120
2. Which eye, preference for answer A removed wrong eye for 51 images out of 60
3. Which eye, optic disc rule given 60 correct images out of 60

Perception is good. The model knows where the optic disc is, with a median probability of 0.95.

The model is biased: it prefers answer A, whatever it says. When the text of answers A and B is swapped, it still answers A almost every time. Reminding it of the laterality rule makes it give the right eye in 100% of cases.

On question 2, the model picks answer A in 118 decisions out of 120, whether it names the right eye or the left eye. This position bias is known in multiple-choice questions put to language models, and it hides everything else: the score, 58 correct answers out of 120, looks like chance. Once this preference is removed by averaging over the swapped answers, laterality is wrong for 51 images out of 60.

The reversal is systematic, but the preference is weak: the median probability of the correct answer is 0.45. It shows up on the original photographs (26 out of 30) as well as on the mirror images (25 out of 30), on healthy eyes (17 out of 20) as well as on diseased eyes (34 out of 40). When an image is flipped, the model’s answer switches in 21 pairs out of 30. So it does follow what it sees, and it then applies the rule the wrong way round.

On question 3, the convention is written into the question. Out of 120 decisions, only two are wrong, and narrowly: 0.52 against 0.48. After averaging over the swapped answers, no image is wrong.

This fix comes down to one sentence added to the question: the model is configured in the question, in plain language. A classic classifier learns its rule from examples. The one by Liu et al., designed for laterality alone, required 18,394 annotated fundus photographs, and changing what it does requires new images and new training. Here, an ophthalmologist reads the rule in the question, checks it and changes it in a few seconds, and the same method works for other questions without retraining anything.

What is already known

The difficulty multimodal models have with fundus laterality has already been published. FunBench, a benchmark presented at MICCAI 2025, asks GPT-4o, Qwen2.5-VL, InternVL2.5, LLaVA and other models “left eye or right eye?” on fundus photographs from several public datasets, including IDRiD. They all score close to chance. The authors also show that the part of the model that encodes the image contains the information: a simple classifier trained on its outputs recognizes the eye in more than 8 cases out of 10. They attribute the failure to how rarely the subject appears in training text, laterality being too basic for anyone to write it down.

The preference for the first option is also documented: language models favor certain answer letters regardless of content, and this effect is corrected by permuting the options.

We found no work describing the mechanism we observe: an optic disc located correctly on every image, then a wrong eye in 85% of cases once the preference for answer A is removed, well below chance, and a reversed rule that the model states itself. The raw answers gave 58 correct out of 120, a score that looks like chance. A score close to chance can therefore hide a reversed rule, masked by position bias.

What we changed

Every laterality question put to the model now contains the anatomical rule, as written in question 3. The model already places the optic disc in the right spot, and this reminder is enough for it to deduce the right eye.

We also ask each question twice, with the answers swapped, and average the results. Without that, position bias alone would have hidden the reversed rule, and we would have concluded that the model was answering at random.

The limits of this test

The 30 eyes come from a single public dataset, and all the photographs are centered on the macula. We tested a single version of the model, compressed to fit on our graphics cards, and we do not know whether the full version makes the same mistake. The comparison with other models covers only one image. Finally, laterality is only a first check: we are preparing a glaucoma test based on OCT images.

If you are considering a local AI server for your center or practice, a thirty-minute conversation is usually enough to find out what it can take on. Write to us at the bottom of the page, or book a slot directly in our calendar.

Sources

Frequently Asked Questions

Does the model see the image the wrong way round?

No. When asked which side of the image the optic disc is on, it answers correctly in 120 decisions out of 120. The error comes at the next step: it applies the rule “disc on the left, right eye”, which is the reverse of the convention.

Is it enough to state the convention in the question?

On our 60 images, yes: with the convention written into the question, laterality is correct for all 60 images. This is the fix we adopted: the rule now comes with every laterality question we put to the model.

Do other models make the same mistake?

The FunBench benchmark, published in 2025, finds scores close to chance for GPT-4o, Qwen2.5-VL and several other models on the same question. On our side, we compared models on a single image only: Qwen 35B and MedGemma gave the right eye, Qwen 9B the wrong one. A single image is not enough to draw a conclusion.

Ready to automate your processes?

Let's discuss your needs and see how transtorm.ai can help

or Book a call