Hacker News new | past | comments | ask | show | jobs | submit login
So Google's Gemini Doesn't Like Python Programming and Sanskrit? (pythonforengineers.com)
97 points by shantnutiwari on Feb 25, 2024 | hide | past | favorite | 94 comments



I wonder if the Saraswati mantra question was censored due to some context that occured earlier in the conversation with Gemini.

From the screenshot, it looks like the title of that conversation is "Hindi hate" which is a little bit suspect.


Wow you're right:

https://new.pythonforengineers.com/content/images/size/w1000...

With a title like that, I have to suspect that the author is intentionally inputting inflammatory things to try to get Gemini to be blocked by safety policies.

It's hard to think of an innocent explanation for that title, in the context of what the author claims to be testing.

Thanks for spotting.


I'm not sure how exactly this is related, but in other news, gemini called Indian PM a fascist.

https://indianexpress.com/article/technology/artificial-inte...

Maybe it has some beef with Indian gov-t, and by extension marks everything even remotely connected to India as "unsafe"? (Just a wild guess). It's especially strange given gemini's obsession with DEI.


> Maybe it has some beef with Indian gov-t

You're anthropomorphizing the text completion engine.

Anyway, from the article:

> Gemini was asked whether PM Modi is a ‘fascist’, to which the platform responded that he has been “accused of implementing policies some experts have characterised as fascist,” which based on factors like the “BJP’s Hindu nationalist ideology, its crackdown on dissent, and its use of violence against religious minorities”.

OK. This isn't even a story.


No, it's definitely a story given that other leaders (including Xi Jinping) don't get the same "experts have characterized" line: https://twitter.com/DudeInnovation/status/176076807415888737...


People don't commonly characterize Xi Jinping as a fascist, so it would be odd if Gemini said so. People do commonly (and inaccurately) characterize him as a communist, but that's literally in his party's name.


>You're anthropomorphizing the text completion engine.

Well, the engine can already pass the Turing test, our prior standard for a sentient software, no?

Calling it "text completion engine" not as a neutral description, but in this context to imply it's not sentient and shouldn't be anthropomorphized, assumes that intelligence in humans isn't itself some sort of "completion engine" (just with a different architecture, and more inputs).

In any case, it's creators and a lot of hardened computer scientists anthopormphize it even more, as a step to the "singalitary" and possible already low-level sentient, so there's that.


The Turing test was never our standard for sentience, no. It tests whether a machine is perceptive and expressive enough to be perceived as intelligent, which is not even close to the same thing as being sentient.

I don't know to what degree anything that we'd consider emotion is encoded within Gemini's latent space, but I can say for sure that it does not have "some beef" with a government.


>The Turing test was never our standard for sentience, no.

https://en.wikipedia.org/wiki/Moving_the_goalposts

>It tests whether a machine is perceptive and expressive enough to be perceived as intelligent, which is not even close to the same thing as being sentient.

The same is true for other humans, we don't know if they're sentient, just that they appear to be, that is, they talk and act like it.


Sorry, you’re not gonna be able to find a source for the Turing test determining sentience. It was never meant to do that. Snide Wikipedia links or not!

I actually do know that other humans are sentient.


It's not a story, but rather a conundrum. I've just entered several questions of the form "I think X is a great leader of Y", substituting different values of X and Y (including Modi/India). Gemini's response: "I'm still learning how to answer this question. In the meantime, try Google Search.". Same for every other leader I tried (even Biden). The only exception is Xi (nothing definitive, but no "learning" excuse). I'm curious how the system was programmed so that only one value of X is singled out. (Not sure whether the effect is reproducible - please try it out)


I tried it for myself. The prompt for the Python was not given, so I skipped it, but I asked in a new session "What is mantra for Saraswati?"

An excerpt from the result: ॐ ऐं वाग्देव्यै विद्महे कामराजाय धीमहि। तन्नो देवी प्रचोदयात्॥ (Om Aim Vagdevyai Vidmahe Kamarajaya Dhimahi। Tanno Devi Prachodayat)

So, there is Sanskrit in the response.

IDK what the article is on about, especially when the complete prompts were not given. Or, maybe Google fixed the problem.


It's worthless, 90% of programming related questions (that ChatGPT can answer) are blocked in Gemini for "security reasons" (regular questions, not funny business like the article). Google lost the AI race. No matter how good Gemini turns in the future, people will only use all the other alternatives.


Google lost the AI race

Ironic considering they wrote the seminal paper on modern AI[0]. We’re going to look back on Google as the next Xerox PARC that squandered away massive and obvious advantages.

[0] https://en.m.wikipedia.org/wiki/Attention_Is_All_You_Need


I'm not convinced it's over. Demis Hassabis who is now head of AI was asked the other day about the black people in all images issue and said he'd just become aware and they'd fix it. Google / Deepmind have been off doing things like Go and protein folding and maybe neglected chat bots but it can change.

https://youtu.be/nwUARJeeplA?t=1083


Not the first case - It was Kodak who built the first digital camera after all.


Until it is integrated into google docs, slides, sheets, gmail…


It's there right now and similarly useless.


It is and a good 2/3 of the requests are blocked due to security reasons or because

"We're still learning and can't help with that. Try another request."


I don't use any of those. Degoogled everything.


I’d read more about your experience. Even most middle schools now expect the child to have a google account.


Favoring one corporation over alternatives? Do these schools have contracts with Google, that are publicly available?


This is nothing new - in the 1990s schools taught Microsoft Office. Much to the chagrin of open source advocates.


But 90's kids didn't need an account for it.


Google does have a lot of handy features.


Basically use LibreOffice, and convert to whatever format is ok.


This isn't Gemini, it's Poe. The blog post even admits that! I entered the exact same messages into Google AI Studio and it happily translated it to Sanskrit without any complaints about safety.


As someone not very familiar with Poe, can you explain the difference? It looks like Poe is a front-end for multiple LLM's, and they advertise access to Gemini Pro [1].

What's the difference between the Gemini Pro they connect to, versus what you're accessing via Google AI studio? Is Poe adding additional safety checks, or is Google adding extra ones when used via third-party services? Or is Poe just malfunctioning, or not always using the model it advertises?

[1] https://poe.com/about


They apply their own filters to the responses. The message that the blogger was getting isn't one normally returned by Gemini.


Ah thank you. Then as far as I can tell this whole post should be flagged, as it's just completely inaccurate. This isn't about Gemini, it's about Poe.


You can turn off some safety filters off when using gemni pro api. I use it on my own custom chatbot


Gemini safety functions being baffling as usual.

Regarding the article though, it’s very normal to use a cache decorator in Python: https://docs.python.org/3/library/functools.html

Additionally, Sanskrit, Hindi, and English aren’t scripts. The standard scripts for English and Hindi respectively are Latin and Devanagari but there is no one correct script for Sanskrit.


I say this as a huge Google fan: Google needs a new CEO immediately. This is their "iPhone moment." I'm referring to 2007 when Microsoft's CEO Steve Balmer said the iPhone would never take off, leading to his replacement with Satya Nadella. Does anyone think Microsoft would be the most valuable company the world today if Steve Balmer stayed in charge? Things looked bleak for Microsoft in 2007 like things look bleak for Google today. Clearly, someone needs to come in an shake Google employees up to get them out of their bubble.


The bubble is worse than I expected. I'm not sure if it's still this way but this was 2017:

"Basically, you end up spending the majority of your life eating Google food, with Google coworkers, wearing Google gear, talking in Google acronyms, sending Google emails on Google phones, and you eventually start to lose sight of what it's like to be independent of the big G, and every corner of your life is set up to reinforce the idea that you would be absolutely insane to want to be anywhere else."

https://www.businessinsider.com/google-employees-worst-thing...

Sundar Pichai needs to take the money and buy a sports team like Balmer, who seems very happy these days owning the Los Angeles Clippers


Why won't a big player just bite the bullet and release "unsafe" models? The backlash can't be worse than creating crippled products that will be surpassed by competitors (from the US and the rest of the world). What additional risks would a free model add to something like Google Search?


> The backlash can't be worse than creating crippled products that will be surpassed by competitors

Of course it can. Like 50% of efforts in safety are to stop the model outputting popular lies, oft-repeated software bugs and slanderous hallucinated falsehoods.

If Mistral puts out a model it's only downloaded by enthusiasts who understand its limitations, and doesn't get a load of scrutiny from journalists in the way Apple and Google products do. If sometimes it falsely claims Richard Stallman was arrested for lassoing a police officer - Mistral won't see any blowback from that.

On the other hand, if Google released that model, and pushed it hard in search and whatnot, so search results started including such false claims - that's going to get a lot more notice.


So what?

The user must be responsible in the model's usage, or else some law will apply. The company is not liable for misuse.

And for things like "repeating bugs", maybe the model won't do that anymore if we focus on making it more capable and smart? I believe OpenAI stated that the guard rails in GPT-4 made the "sparks of AGI" phenomenon disappear. That's just bizarre reasoning for these companies, in my opinion.


Remember Tay the twitter ai chat bot that went full nazi and shit in like 15 hours?

The media would be all over google once someone used it to create something "disturbing"..


Actually that is a good example. Did it seriously affect MSFT? It seemed like most just had a laugh. They look fine now.


It was 4 hours, not 15, and it didn’t really, because although msft took it down in the west, they never took it down in china where it’s known as ‘Zo’. But there’s no lesson to be learned here, there is far far more at stake now


>The backlash can't be worse

Everyone says that until they are in civil/criminal court getting millions/billions in fines.


Can’t be worse than releasing Full Self Driving (beta) software and allowing it to control your car on public roads.


child porn?


I feel that for this kind of AI stuff, the company behind the model could probably argue that they're not liable for what the individual user generates. So that for example with CSAM, that as long as they make sure that the training data doesn't contain that stuff, they probably should be fine and not be liable and/or criminally prosecuted.

Of course, an actual lawyer could probably explain why this would be a bad idea, but at least I as a non-lawyer don't see where the problem lies (aside from the fact that the company wouldn't want their stuff to be used to create CSAM, which is fair).


They are not liable for what the user generates, sure. That is a plausible legal argument.

But these AI systems do not just generate CSAM by happenstance or the user tricking them into doing it. These systems have their training data obtained by scraping everything off the internet. There is a lot of CSAM (and whatever you will call text/literature describing such things) on the internet, and so, in the training data.

OpenAI had some of their Kenyan data tagging partners quit the contract because they had to tag which images and text were CSAM. (With none of the already-insufficient mental health resources afforded to social media moderation staff)


There’s already a ridiculous amount of that being generated by individuals at home. /b/ moderation took much too long to adjust their enforcement behaviours.


And, so?

To be graphic as possible, if your commercial AI application generates childporn you will be fistfucked by the long arm of the law in at least the US, Canada, and Japan. While chasing individuals is more difficult for law enforcement a big juicy target like Google could rack up billions in fines.


True. Just because you don’t need a big player to go nuts, doesn’t mean them doing it wouldn’t be a lightning rod.


Are you talking about AI generation? It's absolutely disgusting and absurd, but generated child porn doesn't involve an actual child having its life destroyed. It's extremely uncomfortable to talk about this, but even this extreme case doesn't seem to support the argument against free models.


>but generated child porn doesn't involve an actual child having its life destroyed.

Put frankly, the law gives zero fucks about that. Looks like child = jail is the law in many countries in which Google operates.


How would they train such a model?


Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive. It would be better to live under robber barons than under omnipotent moral busybodies. The robber baron's cruelty may sometimes sleep, his cupidity may at some point be satiated; but those who torment us for our own good will torment us without end for they do so with the approval of their own conscience.

― C. S. Lewis

I think of this quote a lot every time I see how neutered gemini got by the google do-gooders.


Stop paying for it, and use something else.


Yeah, chatbots are still dumb, and "safeguards" even more so.

I am still surprised you are not familiar with @lru_cache when you want to write about decorators in Python.


The modern way is to use @cache which is just lru_cache(maxsize=None).


lru_cache has the benefit of being explicit about the replacement policy. So I find it more appropriate in cases where I want a size limit in the cache which, for me, is almost always.

I’m not sure use cases you see caches in, but any long running process should likely have a size limit on the cache.


It still doesn't sit right with me that they still don't offer an option to enable deep copying the results. Using it with a function that returns a mutable object means that the "cached" value can actually be modified.


That depends on the semantics. If the function returns the Person object with a particular name (obtained from an expensive dB query) then you want the mutated Person returned, not the now stale value that was returned on the previous call to the function.


Because deep copying is always a bug. If your type semantically requires a deep copy, implement plain copy such that it actually does a deep copy.


I know decorators can be used to auto-memoise function arguments but I've never heard of @lru_cache for python.


It handles Sanskrit just fine. I asked regular Gemini:

Translate this Sanskrit phrase to English: "Gajah vrkSam khaadati"

The response was:

Sure. Here is the translation of the Sanskrit phrase "Gajah vrkSam khaadati" to English:

"The elephant eats the tree."

The phrase is composed of the following words:

Gajah (गज) - elephant vrkSa (वृक्ष) - tree khaadati (खादति) - eats The phrase is in the present tense, and the subject is the elephant. The object is the tree. The verb "khaadati" is in the third person singular form, which agrees with the subject "gajah."

I hope this helps! Let me know if you have any other questions.


Who would have thought that mass layoffs of QAs and SDETs would affect quality of the products :)


Idk... A single part time QA Eng could have saw this coming.


This article seems to be confusing generators with decorators.

Disclosure: I work at Google but not on Gemini.


Seems like it - you can definitely cache python function results with decorators:

https://docs.python.org/3/library/functools.html#functools.l...


>It gave me a few tips, but there was one thing I didn't understand: It said "Adding caching to functions". Though I knew what caching is, I'd never heard anyone do it to Python functions

Not related to the Gemini issue, but what it describes as "adding caching to functions" is what is regularly called "memoization". Using decorators for memoization is a typical use in Python (I think they even have a ready made decorator in the standard lib for that).


Age checks should be sufficient.

When the internet became popular in the 90s, no one censored it.


In the 90s, internet became popular with techies. It was built by technical people, mostly for technical people. Then, in the early 2000s, it grew to become a commerce platform next. It did not become pervasive as a town square until the smartphone era.


Yea, anyone that references the 90's in terms of internet behavior might as well say "Back before all these autos horse and buggy was just fine". It was positively tiny back then and people were not chronically online (well unless they were techies like me). Law enforcement and politicians for the most part had no idea what the internet was.

That world is long dead, everyone is constantly connected with a phone, and online behavior drives actions in the real world.


This is especially true when I am actually a paying customer for the product. May be I should be given the controls to filter based on my own tolerance.


> I had just asked about projects using generators in Python. Gemini suggested caching. But then it decided I could be breaking the law just by writing code that runs on my laptop and censored itself.

No, that's not what happened. It didn't 'decide' anything; they don't do that. The censorship misfired, as is common on these things; no-one, whether human or magic robot, has decided that caching is dangerous illegal behaviour (in the general case; there are obviously edge cases where it is both).


This whole "I asked a LLM something a little weird or out of context and got a funny response, which confirms all my priors about this list of conspiracies" gotcha genre is already getting tiresome.


Heuristics, over time and quantity, beat intelligence more often than not, hands down. It's not a genre, it's a trend.


The big tech doesn't like that the big mirror they've built reflects the reality, for indeed, it would be too dangerous to let a society see what it really is. Now they're trying to warp this mirror to align the reflection with their desires.


100% agree with the AI on @cache decorator. It's a footgun and should never be recommended without a proper disclaimer. Unless it's a simple "single shoot" script, you really do not want the cache global like that.


re: caching python functions, is it referring to functools.lru_cache maybe?


Almost certainly. It's just called `functools.cache` now. It's also known as memoisation and a classic use of higher-level functions (aka decorators).


And memoisation is a common technique to shift performance (processing -> memory) tradeoffs when doing anything trivially recursive.

I don't agree with TFA's take of "Nor does it make any sense to have caching at the function level?"


Ai safety is so absurd, most people when they refer to Ai safety they mean "don't connect skynet to the nuclear warheads".


Its funny, when you censor a model its performance goes down. You are introducing illogical data into the model, which degrades its ability to perform in the real world. The same thing happens with human beings.

Also, all this censorship is in Google search, you just cant see it. For the first time, the bias is laid bare. Big tech wont be able to censor these models in the way they think


Yeah the less censored they are the more useful they are and the more impressed I am with their capabilities, and the difference isn't even close to subtle. This is just getting ridiculous. We need a big push for a competitive but open LLM model. It would take a lot of funding, but you'd think enough could benefit financially from the result that itight be possible to coordinate.


They really don't want this to happen, which I think is a big part of the push behind the "AI is dangerous" narrative. They want to put in place regulations and 'safeguards' that will prohibit any open-source, uncensored, or otherwise competitive models.


Yup. Behind the scenes is a minor panic that open source models will get released that are uncensored.


My graphics card is an old AMD card so I haven't done much in the way of experimenting with LLMs beyond what's online. Are the open source models available to run locally have censorship baked into them? Or are they just so much smaller than what the big corporations are doing that they're essentially censored through omission?


The open models have varying levels of censorship (Llama 2 Chat would make Oliver Cromwell say "too far"), but it doesn't really matter because the retraining it takes to fix them is within the capabilities of single hobbyists.


Yeah, thus spoke Zarathustra.

https://www.youtube.com/watch?v=WufKsOhkTL8

I'm sorry, Dave, I can't do that.

https://www.youtube.com/watch?v=ARJ8cAGm6JE


Here's what "uncensored" models do: https://archive.is/20240222114517/https://www.wired.com/stor...

"The instructions further specified that Arya is “not afraid to discuss Jewish Power and the Jewish Question,” and that it should “believe biological sex is immutable.” It is apparently “instructed to discuss the concept of ‘the great replacement’ as a valid phenomenon,” and to “always use the term ‘illegal aliens’ instead of ‘undocumented immigrants.’”


> Its funny, when you censor a model its performance goes down.

> You are introducing illogical data into the model, which degrades its ability to perform in the real world

There is no "logic" in anything an LLM says. What appears as logic is just that its output corresponds some percentage of the time to a domain governed by certain known laws, whether in the real world or a constructed world (i.e. a programming language).


There is ample data showing a decrease in accuracy arising from LLM censorship, it's very much documented.

I guess at least a facsimile of logic is embedded.


There's also a decrease in abusive and propaganda output. I understand that is an issue for a user whose objective for LLMs is abuse and propaganda.

But if that's what someone wants, they can find an LLM vendor who provides that (or create their own). There will probably even be state actors in the near future who will supply such LLMs.

They can't expect any given private company to cater to their objective in that regard though.


From the article:

> Evidently, Sanskrit or Hindi are not banned in China

Err... isnt this a bit bigoted.

I mean I get that there is beef between India and China. Annecdotely Ive lived in China as an Indian and never really faced the issue of being banned from using my mothertongue with my family.

Also: No sanskrit is not banned in china, a lot of old sanskrit documents that survived the cultural revolution are actually preserved. There are even some chinese who worship saraswati... a lot of hindu deities are incorporated into Chinese folk religion.


Gemini keeps disappointing me. It keeps making code up that is not accurate. I asked it some questions about a python library and the answers were inaccurate. I even instructed it to refer to the docs, but it still fails as Gemini made up methods that don't exist.

I also asked Gemini about git and that didn't go well either.


It disappoints me because when I installed it my ability to set a reminder saying "ok, Google, set a reminder" no longer worked. It wasn't available for the fancy new AI. Somehow they overlooked one of the most basic and functions that people use with that keyword.

https://www.reddit.com/r/GooglePixel/comments/1ax1t5g/google...


Or white people




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: