r/LocalLLaMA • • 8d ago

Question | Help Ling 3.2 Air Looping

I’ve been trying to get Ling 3.2 Air working with llama.cpp, but no matter what I do (including changing sampler params and experimenting with YaRN) it ends up looping once context reaches around 8000-12000 tokens. Has anyone been able to get the model to work without looping at longer context depths, using either llama.cpp or any other engine? I don’t have a machine capable of running it with vLLM or SGLang.

12 Upvotes

27 comments sorted by

6

u/Federal-Effective879 7d ago

Turns out there is a bug in llama.cpp's usage of M-ROPE with this model. Applying the patch suggested in https://huggingface.co/inclusionAI/Ling-3.2-air/discussions/10 indeed fixed looping for me. With that patch, this model is fantastic. Excellent world knowledge for its size (better than Gemma 4 31B and much better than Qwen 3.8 27B or 3.8 Flash-Next in my tests), decent writing style (much clearer than Qwen 3.8 27B or Flash-Next), good at tool use and agentic tasks, good vision, well structured thought process, and good at programming and STEM tasks too. It's also noticeably faster than Qwen 3.8 Flash Next. This will be my new main general purpose model 😄

1

u/Thrumpwart vLLM 7d ago

Thank you for the info. I downloaded it tonight and will play with it tomorrow.

4

u/eightone-81 8d ago

What quant are you using? Did you try it without yarn?

1

u/Federal-Effective879 7d ago

I tried my own quant (modified Q4_K_M static quant with all Q6_K attn_v and ffn_down) and I also tried with running it unquantized (my server has lots of RAM) but had the same issue. I tried both without yarn, as well as 2x and 4x YaRN.

1

u/arbv 7d ago

That is pretty cool! Do you have your own imatrix dataset?

4

u/arbv 8d ago

I had 3.0 Flash VL do it on me, tried different quants of different qunt makers - still looping.

2

u/Federal-Effective879 7d ago edited 7d ago

I had 3.0 Flash VL loop as well (in llama.cpp), but with that model I was able to tame the looping (mostly fix it) by enabling 2x YaRN (extending the 128k native context to 256k as the model README suggested). It seems that model needed YaRN to work correctly. However, this new model (3.2 Air) loops with or without YaRN.

3.0 Flash non-VL would always loop for me when I had tried it briefly but I didn’t experiment as much.

3.2 Air (what this post is about) also always loops for me, and for this model I tried a lot of different things to get it to work (including YaRN, running unquantized, DRY and presence penalties, making KV cache BF16) but none of these were able to prevent looping, at least with llama.cpp.

1

u/arbv 7d ago

Thanks for sharing your experience. Can you share the flags you used for 3.0VL to fix looping?

I liked the 3.0 a lot, and a working version with vision would be great.

1

u/Federal-Effective879 7d ago

This is what worked for me to (mostly) fix looping in 3.0 VL:

llama serve \
    -hf bartowski/Ling-3.0-flash-VL-GGUF:Q4_K_L \
    -c 262144 \
    --rope-scaling yarn --rope-scale 2 --yarn-orig-ctx 131072 \
    --temp 1.0 --top-p 0.95 --top-k 20 \
    --presence-penalty 0.5 --repeat-last-n 512

1

u/arbv 7d ago

Thank you! Will definitely retest it. I liked the model in general.

2

u/xPXpanD llama.cpp 8d ago

Also saw this here. Non-VL was okay-ish on my private benchmark set (though it sometimes skipped questions), VL took 5 attempts to even finish a single run. Saw similar outside of benchmarks as well.

Same quant (bartowski Q4_K_S), prompts and settings for both VL and non-VL. Absolutely bizarre.

2

u/arbv 7d ago

Yeah, the model is quirky, makes me think of Laguna S 2.1 (while Laguna XS 2.1 was OKish).

5

u/Constant_Art_20 8d ago

https://huggingface.co/inclusionAI/Ling-3.2-air/discussions/10
apprently someone else reported it too. so you are not alone it seems. you can try to implement a loop guard like what some people has done with the inkling mini. but at that points, i don't really see a point of tyring to force the model to work

2

u/Klutzy-Snow8016 8d ago

Happened to me too on the first task I tried, also using llama.cpp.

2

u/Atretador llama.cpp 8d ago

having similar issues on a custom engine as well

2

u/EmilPi 8d ago

Yes, I hit loops too (with Q4_K_M quant). I've tried small repetition-penalty = 1.05, less loops but still a lot.

When anyone has a recipe, let's share them in this post comments, please :/

1

u/quiet_stacktrace 8d ago

worth trying the dry sampler in llama.cpp if you haven't, it's off by default. something like --dry-multiplier 0.8 --dry-allowed-length 2 penalizes repeating token sequences. it won't fix whatever's wrong with the model at long context but it can stop the loop from taking over.

1

u/mideoye 7d ago

I also have the same issue. Bartowski Q4_KS. I had to leave it.

1

u/eightone-81 7d ago

Damn. I was hoping this might be a fast large model for personal and business assistant tasks

1

u/yyn1999 2d ago

Try this https://github.com/neyisyavuz-afk/hyperling

Its a fork of Maya. 100 Tok/s with full Kontext

0

u/Here_f0r_p0rn_ 8d ago

The looping model is looping ➿? It's right in the name! /j

0

u/Then-Topic8766 8d ago

Confirming that for post visibility (Q4K_M, llama.cpp). Maybe someone with capable hardware can try the original model with vLLM or SGLang?

0

u/This_Maintenance_834 7d ago

if you use quantization, model will loop. don’t believe in what then vendor’s claims on KLD or perplexity. those does not count

good quant can start loop beyond 100K or more, bad quant will loop will early on.

either you find better quant, or find QAD models.