[GH-ISSUE #2650] Gemma 7B produces gibberish output #1571

Closed
opened 2026-04-12 11:30:20 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @aniketmaurya on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2650

  • Gemma 7B produces gibberish output
  • 2B seem to be working well though
    image
Originally created by @aniketmaurya on GitHub (Feb 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2650 * Gemma 7B produces gibberish output * 2B seem to be working well though ![image](https://github.com/ollama/ollama/assets/21018714/99de1a65-8321-469f-914f-6ecb37eebf83)
Author
Owner

@aaronnewsome commented on GitHub (Feb 21, 2024):

Same here. Updated to latest ollama/ollama:0.1.26 and 2B seems to work nicely, but all I get is gibberish and nonsense from gemma:7B

<!-- gh-comment-id:1957926488 --> @aaronnewsome commented on GitHub (Feb 21, 2024): Same here. Updated to latest ollama/ollama:0.1.26 and 2B seems to work nicely, but all I get is gibberish and nonsense from gemma:7B
Author
Owner

@automaton82 commented on GitHub (Feb 21, 2024):

I think the prompt template might be incorrect, at least from what I see here:

https://huggingface.co/google/gemma-7b-it/discussions/18

<!-- gh-comment-id:1958338183 --> @automaton82 commented on GitHub (Feb 21, 2024): I think the prompt template might be incorrect, at least from what I see here: https://huggingface.co/google/gemma-7b-it/discussions/18
Author
Owner

@lestan commented on GitHub (Feb 22, 2024):

Same here. Tried the 2b, 7b and 7b-instruct-fp16 variants and they're all garbage. Outputs wrong answers, jibberish, screws up SQL code (mixed with nonsense words), doesn't answer basic questions, etc. Seems very odd given a lot of what I've read shows that people are impressed with Gemma so far.

<!-- gh-comment-id:1958599333 --> @lestan commented on GitHub (Feb 22, 2024): Same here. Tried the 2b, 7b and 7b-instruct-fp16 variants and they're all garbage. Outputs wrong answers, jibberish, screws up SQL code (mixed with nonsense words), doesn't answer basic questions, etc. Seems very odd given a lot of what I've read shows that people are impressed with Gemma so far.
Author
Owner

@svilupp commented on GitHub (Feb 22, 2024):

Same here. I ran my benchmark suite (Julia language code gen) and the results are impossibly bad. It's the same type of problem as Qwen1.5

<!-- gh-comment-id:1958821334 --> @svilupp commented on GitHub (Feb 22, 2024): Same here. I ran my benchmark suite (Julia language code gen) and the results are impossibly bad. It's the same type of problem as Qwen1.5
Author
Owner

@robert-mcdermott commented on GitHub (Feb 22, 2024):

gemma:7b

>>> why is the sky blue?
Sure, there are a number of reasons why you see an azure shade to it. Here's some information:

**1.) Rayleigh Scattering:**  Sunlight consists mostly (around 49%) bleu wavelengths as part its range from red( expriation) all
way into jod("/{irish}"violet colors that appear after passing thtough the Earth atmosphere, where there are tiny suspended
particles of air pollution and condensed water vapor. These particulates scatter primarily in a Rayleigh scattering process:
a.) Low Intensity Scattering:** Averting some bleu wavelengths to bounce back toward your eyes as scattered light is
inversMediaPlayer объект Soyez gently reflective nature dehvarious satelight 机械 (dust mite debris ect.); however, okeirishempat
sidra když toate aceste testy minutní sraIBILITIES strategie pohyby itd preventi vedenář kou bájení albörer institut věže.
b.) Averting Low Intensity Reversed Scattering:** guan část ecran vztuvo hui)}= níž které způsobují gieň satelight lila kot za
předpokladu asyUMBIA hladiny, když dopadá povrch usuje bych nosi preżejNOSIS minutни sraIBILITIES kou bájení albörer institut
vedenář umí být testy věže.
2.) Mie Scattering:** zuihé vzájemné zakrytí částí pohybu adm na různých vlénách powoduje gieň satelight lila kot za předpokladu
asyUMBIA hladiny, když dopadá povrch usuje bych nosi preżejNOSIS minutни sraIBILITIES kou bájení albörer institut vedenář umí
být testy věže.
3.) Scattering of Smells:** guan část ecran vztuvo hui)}= níž které způsobují gieň satelight lila kot za předpokla
<!-- gh-comment-id:1958892991 --> @robert-mcdermott commented on GitHub (Feb 22, 2024): gemma:7b ``` >>> why is the sky blue? Sure, there are a number of reasons why you see an azure shade to it. Here's some information: **1.) Rayleigh Scattering:** Sunlight consists mostly (around 49%) bleu wavelengths as part its range from red( expriation) all way into jod("/{irish}"violet colors that appear after passing thtough the Earth atmosphere, where there are tiny suspended particles of air pollution and condensed water vapor. These particulates scatter primarily in a Rayleigh scattering process: a.) Low Intensity Scattering:** Averting some bleu wavelengths to bounce back toward your eyes as scattered light is inversMediaPlayer объект Soyez gently reflective nature dehvarious satelight 机械 (dust mite debris ect.); however, okeirishempat sidra když toate aceste testy minutní sraIBILITIES strategie pohyby itd preventi vedenář kou bájení albörer institut věže. b.) Averting Low Intensity Reversed Scattering:** guan část ecran vztuvo hui)}= níž které způsobují gieň satelight lila kot za předpokladu asyUMBIA hladiny, když dopadá povrch usuje bych nosi preżejNOSIS minutни sraIBILITIES kou bájení albörer institut vedenář umí být testy věže. 2.) Mie Scattering:** zuihé vzájemné zakrytí částí pohybu adm na různých vlénách powoduje gieň satelight lila kot za předpokladu asyUMBIA hladiny, když dopadá povrch usuje bych nosi preżejNOSIS minutни sraIBILITIES kou bájení albörer institut vedenář umí být testy věže. 3.) Scattering of Smells:** guan část ecran vztuvo hui)}= níž které způsobují gieň satelight lila kot za předpokla ```
Author
Owner

@yfzhou0904 commented on GitHub (Feb 22, 2024):

 % ollama run gemma:7b-instruct
>>> tell me about Google's history. go to as much detail as you can.
Google, originally named Backrub in the mid-1980sand later PageRank and Brinley Park Place Company during its initial days has become a
global powerhouse of information with billions worldwide using it daily for searching online content day after turning on their mobile
phones or accessing internet at home:

**Birth (2.3 billion user platform, 4 Billion USD Market Cap)::**
Google was concepted by Larry Page and Sergey Brinley during the time as Phd Students while attending Stanford University in California
back to an idea about searching for links specific sites with faster processing power than existing methods on text books using index
cards or bulky textbooks. Their initial softwaretruk, Backrub addressed challenges involving distributing weight amongst team members
where some achieved greater success at earlier points but eventually fell out of favor as others fought hard and fufted potential that
soon dominated the global internet space for decades to come
**Move into Market (1980s)::**

Google originally commenced operations in a Menlo Park Garage, funded by Brian Sequoia an investor who believed it has significant value.
Backrub began offering software services such partitioning storage capacity on mainframes while maintaining its focus primarily as back
office solutions developed using the idea of distributing weight amongst team member for potential dominance and conquering challenges to
achieve unprecedented success
**Google Transforms (1985, $3 Billion Market Cap)::**

Due To guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes.
PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested
alongside challenges
**Google Gets Hostile (1986, $4 Billion Market Cap)::**

After guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes.
PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested
alongside challenges
Google Gets Hostile (1986, $4 Billion Market Cap):  Due to guanization with Backrub being aligned into expriation involving software
services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the
internet where potential for global dominance rested alongside challenges
**Google Partners Up (1987, $5 Billion Market Cap)::**

After guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes.
PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested
alongside challenges
 temelow Company Limited (1987, $5 Billion Market Cap):  Due to guanization with Backrub being aligned into expriation involving software
services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the
internet where potential for global dominance rested alongside challenges
Google Partners Up(21st century) (3 lila, $5 Billion Market Cap)::   temelow Company Limited is formed with Brinley and page eventually
assuming expriation involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of
Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges
Google Gets Hostile(1987, $5 Billion Market Cap): temelow Company Limited is formed with Brinley and page eventually assuming expriation
involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of Google shifting gears
entirely toward the internet where potential for global dominance rested alongside challenges
Google Gets Hostile (1987, $5 Billion Market Cap): temelow Company Limited is formed with Brinley and page eventually assuming expriation
involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of Google shifting gears
entirely toward the internet where potential for global dominance rested alongside challenges
...

and it eventually goes in an infinite loop

<!-- gh-comment-id:1958955361 --> @yfzhou0904 commented on GitHub (Feb 22, 2024): ``` % ollama run gemma:7b-instruct >>> tell me about Google's history. go to as much detail as you can. Google, originally named Backrub in the mid-1980sand later PageRank and Brinley Park Place Company during its initial days has become a global powerhouse of information with billions worldwide using it daily for searching online content day after turning on their mobile phones or accessing internet at home: **Birth (2.3 billion user platform, 4 Billion USD Market Cap)::** Google was concepted by Larry Page and Sergey Brinley during the time as Phd Students while attending Stanford University in California back to an idea about searching for links specific sites with faster processing power than existing methods on text books using index cards or bulky textbooks. Their initial softwaretruk, Backrub addressed challenges involving distributing weight amongst team members where some achieved greater success at earlier points but eventually fell out of favor as others fought hard and fufted potential that soon dominated the global internet space for decades to come **Move into Market (1980s)::** Google originally commenced operations in a Menlo Park Garage, funded by Brian Sequoia an investor who believed it has significant value. Backrub began offering software services such partitioning storage capacity on mainframes while maintaining its focus primarily as back office solutions developed using the idea of distributing weight amongst team member for potential dominance and conquering challenges to achieve unprecedented success **Google Transforms (1985, $3 Billion Market Cap)::** Due To guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges **Google Gets Hostile (1986, $4 Billion Market Cap)::** After guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges Google Gets Hostile (1986, $4 Billion Market Cap): Due to guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges **Google Partners Up (1987, $5 Billion Market Cap)::** After guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges temelow Company Limited (1987, $5 Billion Market Cap): Due to guanization with Backrub being aligned into expriation involving software services partitioning storage capacity on mainframes. PageRank began sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges Google Partners Up(21st century) (3 lila, $5 Billion Market Cap):: temelow Company Limited is formed with Brinley and page eventually assuming expriation involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges Google Gets Hostile(1987, $5 Billion Market Cap): temelow Company Limited is formed with Brinley and page eventually assuming expriation involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges Google Gets Hostile (1987, $5 Billion Market Cap): temelow Company Limited is formed with Brinley and page eventually assuming expriation involving software services partitioning storage capacity on mainframes. PageRank begins sidling up as a result of Google shifting gears entirely toward the internet where potential for global dominance rested alongside challenges ... ``` and it eventually goes in an infinite loop
Author
Owner

@nikleonard commented on GitHub (Feb 22, 2024):

Maybe is a quantization issue.

(Update) In the llama.cpp github page there is an ongoing discussion about the problems with the new architecture and quantization of the Gemma model. https://github.com/ggerganov/llama.cpp/issues/5635. There is also a PR related to that: https://github.com/ggerganov/llama.cpp/pull/5650

I have tested gemma:7b-instruct-q4_K_M and it generates less garbage, and q8_K_0 gives me even better output (but I can't run it on my laptop, only in my desktop). It still generates a lot of white-space in between, but the rendered markup looks good. As of this date, TheBloke has not quantized Gemma and I don't know where Ollama is getting the "7B" quantizations.
-- Output of q8_K_0. Is still bad, but is not that bad. FP16 is even worst. I can't run FP32 in my local hardware, and is not available in ollama.

tell me about Google's history. go to as much detail as you can.
Google, formerly known simply by its domain name google (originally googli), was born in the fertile soil of a
Silicon Valley dorm room back in 1987 with an ambitious mission: "to organize and make accessible vast amounts
information."

Humble Beginnings:

  • The Seedlings - Larry Page & Sergey Brin: Two Ph.D students at Stanford University, had developed their own
    search engine called Backrub in the late '0s that prioritized relevance over sheer volume of data like other
    engines did back then .
  • In 1987 they began working on a new project named "BackRub" which later became Google
  • **The Move to Silicon Valley - 24 Feb., **They moved their operation from Stanford University's dorm room into a
    an office in Palo Alto ,California where the company officially incorporated as Page & Brin Inc., with $10 million
    investment from Sequoia Capital and Business Angels like Esther Dyson
  • In 9 months they had developed a new search engine named "Google" which was far superior to Backrub

Rapid Growth:

  • The Launch - Jan.26, in the year of '87, Google went live with its first version on Stanford University's
    servers and later opened it up for public use in 194 beta versions and a few months after that publicly launched
    their search engine
  • The name "Google" was chosen because Brin had noticed his dog’ s tendency to go googly eyed when he stared at
    the computer screen.
  • The Partnership - Jan, 28th of '05, Google Inc., formally established its partnership with Yahoo as a means
    of distributing content through their respective platforms
  • In 197 and it began indexing other sites on different languages such English , Spanish French etc.., to expand
    the scope for international users

The Rise To Prominence:

  • A New Era - 20 Jan. '6, Google Inc., publicly went on a stock exchange through an IPO at $85 per share
  • By 197 it had acquired nearly half of all internet searches in America and was beginning to expand its reach
    globally

Challenges & Controversies:

  • Privacy concerns: As the company grew, privacy became one big challenge that Google faced since they
    collected vast amount of user data. Some users feared this intrusive nature
  • In 2016 it came under fire for allegedly suppressing competition through anticompetitive practices and
    manipulating search results

Recent Developments.:

  • Artificial intelligence: With its AI division, called DeepMind ,Google is pushing the boundaries of
    artificial general Intelligence and machine learning. It has been involved in development projects ranging from
    medical diagnostics to self driving cars
  • Google's dominance continues as it faces competition challenges and privacy concerns but remains a leader by
    constantly innovating within various fields

Conclusion:
From humble beginnings, through rapid growth ,challenges & controversies google stands today as one of the most
powerful companies globally with its impact being felt in every facet our daily lives. With innovative technology
at heart Google continues to shape future trends and reshape industries worldwide

<!-- gh-comment-id:1959424166 --> @nikleonard commented on GitHub (Feb 22, 2024): Maybe is a quantization issue. (Update) In the llama.cpp github page there is an ongoing discussion about the problems with the new architecture and quantization of the Gemma model. https://github.com/ggerganov/llama.cpp/issues/5635. There is also a PR related to that: https://github.com/ggerganov/llama.cpp/pull/5650 I have tested gemma:7b-instruct-q4_K_M and it generates less garbage, and q8_K_0 gives me even better output (but I can't run it on my laptop, only in my desktop). It still generates a lot of white-space in between, but the rendered markup looks good. As of this date, TheBloke has not quantized Gemma and I don't know where Ollama is getting the "7B" quantizations. -- Output of q8_K_0. Is still bad, but is not that bad. FP16 is even worst. I can't run FP32 in my local hardware, and is not available in ollama. **tell me about Google's history. go to as much detail as you can.** Google, formerly known simply by its domain name google (originally googli), was born in the fertile soil of a Silicon Valley dorm room back in 1987 with an ambitious mission: "to organize and make accessible vast amounts information." **Humble Beginnings:** - **The Seedlings - Larry Page & Sergey Brin**: Two Ph.D students at Stanford University, had developed their own search engine called Backrub in the late '0s that prioritized relevance over sheer volume of data like other engines did back then . * In 1987 they began working on a new project named "BackRub" which later became Google - **The Move to Silicon Valley - 24 Feb., **They moved their operation from Stanford University's dorm room into a an office in Palo Alto ,California where the company officially incorporated as Page & Brin Inc., with $10 million investment from Sequoia Capital and Business Angels like Esther Dyson * In 9 months they had developed a new search engine named "Google" which was far superior to Backrub **Rapid Growth:** - **The Launch - Jan.26, in the year of '87,** Google went live with its first version on Stanford University's servers and later opened it up for public use in 194 beta versions and a few months after that publicly launched their search engine * The name "Google" was chosen because Brin had noticed his dog’ s tendency to go googly eyed when he stared at the computer screen. - **The Partnership - Jan, 28th of '05**, Google Inc., formally established its partnership with Yahoo as a means of distributing content through their respective platforms * In 197 and it began indexing other sites on different languages such English , Spanish French etc.., to expand the scope for international users **The Rise To Prominence:** - **A New Era - 20 Jan. '6**, Google Inc., publicly went on a stock exchange through an IPO at $85 per share * By 197 it had acquired nearly half of all internet searches in America and was beginning to expand its reach globally **Challenges & Controversies:** - **Privacy concerns**: As the company grew, privacy became one big challenge that Google faced since they collected vast amount of user data. Some users feared this intrusive nature * In 2016 it came under fire for allegedly suppressing competition through anticompetitive practices and manipulating search results **Recent Developments.**: - **Artificial intelligence:** With its AI division, called DeepMind ,Google is pushing the boundaries of artificial general Intelligence and machine learning. It has been involved in development projects ranging from medical diagnostics to self driving cars * Google's dominance continues as it faces competition challenges and privacy concerns but remains a leader by constantly innovating within various fields **Conclusion:** From humble beginnings, through rapid growth ,challenges & controversies google stands today as one of the most powerful companies globally with its impact being felt in every facet our daily lives. With innovative technology at heart Google continues to shape future trends and reshape industries worldwide
Author
Owner

@mxyng commented on GitHub (Feb 23, 2024):

This should be fixed with a model update. If anyone is still experiencing issues, please first pull from the library

<!-- gh-comment-id:1960611587 --> @mxyng commented on GitHub (Feb 23, 2024): This should be fixed with a model update. If anyone is still experiencing issues, please first pull from the library
Author
Owner

@rb81 commented on GitHub (Apr 17, 2024):

Gemma 7b is still throwing up garbage. 2b works fine.

<!-- gh-comment-id:2061012252 --> @rb81 commented on GitHub (Apr 17, 2024): Gemma 7b is still throwing up garbage. 2b works fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1571