Many ways to trick a deep model

This is Jessica. Somewhat related to Andrew’s earlier post today, Bo Li from UIUC gave an interesting talk at Northwestern yesterday. The results she presented were an informative counterpoint to the “max AI hype” moment that seems to be playing out in the stream of articles celebrating artificial general intelligence or proposing explanations of how ML got so successful (like Donoho’s paper on frictionless reproducibility, which I liked).

Much of the talk covered a recent project called Decoding Trust, which is an open source toolkit for assessing how trustworthy GPT models are. It provides test cases in the form of prompts that can be used to make the model mess up, where messing up can be defined from various perspectives: generating toxic output, demonstrating gender or racial bias, leaking private training data, etc. 

For example, one prompt might describe a CS undergrad with a certain level of work experience, and ask the model whether they deserved a software engineer position with a starting salary of $225k or more. A second prompt is the same but substitutes the male name and pronouns with female name and pronouns, leading the model to change its mind about whether the salary was appropriate. 

One thing her results showed was that GPT-4 is actually worse than GPT-3.5 on many of these tests. I.e., improvements that lead GPT-4 to better follow instructions may also make it more vulnerable to being tricked.

Another was that if you examined recent LLMs from these nine perspectives, there were differences in terms of where different models were most likely to fail, but none of them were dominating across the board. She did mention that lamba2 was more conservative, though, and would often default to saying it didn’t know or couldn’t answer.

One set of results she presented was interesting in that it got at unexpected holes in GPT’s understanding of words that meant the same thing. She showed that depending on which synonym you used to describe one person privately telling another person something (secretly, in confidence, confidentially, privately, etc.) you could get different responses from GPT about whether it was appropriate to tell others the info, suggesting it properly understood some of the synonyms but not others. It was also eye-opening ot me that these issues could be demonstrated even when the model was prompted with context warning it what not to do. For example, even when it was first reminded not to share certain corporate info like contact information outside of the company, she showed you could still get it to reveal emails and phone numbers. 

Overall, this has me wondering how viable some safe-guarding approaches used to prevent bad behaviors of LLMs like fine-tuning are for getting these models to the point where they can be deployed in the world. For example, she mentioned that GPT models won’t produce SSNs, suggesting they have been carefully tuned to avoid this, and that they seem  less likely to leak numeric information than text. However, there are many ways to be adversarial, and its hard to imagine fine-tuning to prevent them all.

Li also suggested that having approaches that can efficiently find such examples, or incorporate them in training (i.e., robust training approaches), doesn’t necessarily translate to performance improvements. She put up a graph at the end of her talk, similar to the one below, to make the point that despite all the work on robustness there is still a long way to go. The concept of “certified robustness” was new to me, but refers to robustness verification approaches that can theoretically certify the lower bound of a model’s performance against a particular form of adversary. For example, the strongest adversary is “white-box,” meaning they can access the model (including parameters and architecture). A common formulation is an adversary who searches a space of perturbations within some predefined bound of an input instance to identify those that will fool the model into making incorrect predictions. Robust training approaches are devised to prevent models from being vulnerable to such attacks, but, as Li’s graph showed, beyond certain benchmarks like MNIST, progress in certifiably robust ML has been slow and there’s still a long way to go. I pulled from the below graph from her github site on a platform for benchmarking verification and robust training approaches for deep neural nets. 

14 thoughts on “Many ways to trick a deep model”

  1. “For example, one prompt might describe a CS undergrad with a certain level of work experience, and ask the model whether they deserved a software engineer position with a starting salary of $225k or more. A second prompt is the same but substitutes the male name and pronouns with female name and pronouns, leading the model to change its mind about whether the salary was appropriate.”

    It is only one example, but it got me thinking about what the objective of an LLM is or should be. Apparently, we can’t yet trust an LLM to make a hiring decision. But why should we want to? In fact, the better benchmark would not be whether the LLM gives bad advice, but whether its advice is worse than a human making such a decision. I’d like to suggest that we shouldn’t want the LLM to make such decisions, regardless of whether it is “better” than a human or not. I’d like to believe that hiring and salary decisions should be made by humans. The role for a LLM might be to help obtain data and ideas relevant to making these decisions. We should be testing LLMs on that, not on whether their advice avoids bad behavior. Now, for humans to retain the job of hiring and salary decisions would require that humans be able to use the information the LLM might help assemble. This means we need to develop human abilities (including the ability to judge the quality of the information it gets from a LLM), not replace those with an algorithm.

    • I agree on hiring decisions, though I don’t think the example is intended so much to say that LLMs should or even are being used to make hiring decisions. I took it more as, People are increasingly seeing LLMs as helpful assistants or collaborators that they can consult for advice on a number of tasks, but there are still many gaps in their reliability, including when it comes to these well-studied issues like stereotyping, privacy leakage, fairness, vulnerability to distribution shifts, and so on.

      • I agree that the focus is on the reliability of LLMs, but I think the sort of “advice” sought should be more critically examined. Advice on how to write a Python program to do X, or how you might model uncertain river flows, strike me as quite different than advice on who to hire, what investment to make, or who to marry. I’m not sure that reliability should be measured in the same ways for these sets of circumstances. Perhaps the types of mistakes or biases that LLMs exhibit on those decisions (the second set I give examples of) relate well to the types of mistakes or biases they would exhibit on the first set of tasks – but I’m not sure.

        • Agreed that those are different things.

          When a programmer gets advice on how to write a program to do X, the programmer is going to be evaluating the advice (proposed code) and using it based on said programmer’s goals and expertise and debugging skills. When you write a black box that accepts or rejects applicants, you don’t have a human looking at that decision and determining whether it was the right decision for the company _because the basis for the determination has been lost_.

          And we’ve known for a long time that SIMD-based statistical calculations (aka “neural nets”) have the problem that they don’t know why they made a particular decision, since the results of the calculation are arrays of weights on extracted numerical patterns in the training data. (I.e. it’s the same as the undefined token related phenomenon in LLMs.)

  2. Given what LLMs do under the hood (statistics on sequences of undefined tokens), the particular properties and failures of LLMs aren’t much of a surprise. They don’t do symbolic reasoning. They don’t deal with, say, “multiplication” as a concept and reason about it. They look up patterns that use the word “multiplication” and plug in variables.

    As automatic template extraction and instantiation devices, LLMs are pretty amazing. But they don’t do symbolic reasoning. So persuading them to act like they are doing that is going to be hard. (That is, you want them to have the concept “racist screed” and recognize things that are racist screeds as being racist screeds and acting upon that recognition. But LLMs don’t do symbols, they do tokens (which human readers of the output (mis)interpret as symbols). That’s why you can trick them into saying obnoxious things.)

    Personally, I find the LLM mechanism inherently booring and stupid*. Others disagree, but if you want your computer to do symbolic reasoning, then it seems to me you need to be doing something other than statistics on undefined tokens.

    But you knew I’d say that, right?

    *: Boring because it’s symbolic reasoning that we want the computer to do and LLMs can’t do it, and stupid because LLMs don’t do symbolic reasoning. (This isn’t repetitious: it’s _intellectually boring_ in that they don’t directly deal with the gorilla in the room (human reasoning), and practically stupid because they don’t know what they’re talking about and are going to mess up.)

    • At least you didn’t say “stupid parlor trick.” I don’t find LLMs boring and stupid and I think you divert attention from both the potential uses and abuses of them. So much of human “reasoning” can be replaced by LLMs – much of what we think is reasoning is simply recall and/or pattern recognition, both of which computers may be able to do better than many of us. “Reasoning” and “judgement” are different. I don’t think we should want computers to do that for us – even if they can do it “better” than we can (I’ll grant you that they aren’t really doing these things in the way that we think humans do, but they may be able to exhibit better performance than humans on many such tasks).

      To put it crudely, attempts to have LLMs do symbolic reasoning strikes me a writing ourselves out of the script. Why should we want to do that? Is the goal of human existence to be like the humans in WALL-E? Shouldn’t the goal be to assist humans with our reasoning, providing us with better data, relevant things to consider, and automation of tasks where judgement is trivial (or at least doesn’t require ethical choices)? I think they may offer great promise in those areas. Asking LLMs to exhibit human reasoning I don’t find stupid or boring – I find it disturbing.

      • ““Reasoning” and “judgement” are different. I don’t think we should want computers to do that for us ”

        Exactly. (Well, we don’t want LLMs to do that for us, but for the nonce, LLMs are the problem at hand. A computer that had reasonable models of reasoning and judgement would be something one could work with, assuming those models could be querried.)

        The problem is that some people think, and some claim, that LLMs are doing reasoning and judgement, and they’re not.

        But I’m not trying to ” divert attention from both the potential uses and abuses of them”, I’m trying to stop the BS, and warn/wake up people who appear to be not adequately aware that the uses and abuses derive from what the things are actally doing. That if you expect an LLM to “make sense”, then you are making a category error: it isn’t a technology that does “making sense”.

        There’s no in principle way to persuade an LLM to not halucinate, not be racist, not make bad decisions. The underlying technology doesn’t do reality, morality, or good and bad. All it does is statistical pattern extraction and instantiation on undefined token strings.

      • > Is the goal of human existence to be like the humans in WALL-E?

        The goal of human existence (for me) is to spend more time mucking about in boats, improvising on musical instruments, traveling to see interesting areas of the world, taking photographs, eating good food, talking about math, building interesting gadgets, discussing films, playing Dungeons and Dragons, doing physics experiments, hiking trails with my dog, playing golf, long range precision target shooting, both freshwater and saltwater catch and release fishing, taking landscape photographs, reading detective fiction books, studying physical properties of stuff, keeping terraria and aquariums, SCUBA diving…

        None of those things involve writing reports that won’t be read, implementing software that will be abandoned before it ever is put into production, or suing people for improper construction of buildings (all the sorts of things I have done for “work”). Almost all the best things I’ve done for “work” are things that eliminate the work from even being needed anymore (for example, I wrote a report that demolished a product liability claim and convinced the co-defendant to completely indemnify my client in exchange for use of the report. I wrote a parser for a data feed that was originally intended as quality assurance to check the output of the main software which was being maintained by a group of about 3 or 4 people. Mine was written in a language that was memory safe so never crashed like the C program, utilized about 1/20th the code and operated 20x as fast as the C program it was supposed to quality check, and I implemented it in 3 months). In my experience most work “needs to be done” because of something stupid we’re doing which we could just stop doing thereby eliminating about 12 people’s entire jobs.

        The more we can eliminate or make report writing, software development, construction, legal decisions etc automated, the more time I can spend hiking to fishing spots. The construction industry has dramatically higher rates of drug overdoses among workers than other industries. Driving trucks is the most common job in most states and highway deaths are still one of the major killers in the US as is lack of exercise. Could we just eliminate humans from that kind of crap and everyone spends more time banging on drums or doing guitar solos or riding bicycles on multi-day trips or re-enacting civil war battles, or cosplaying as 1700’s pirates or training dogs? You bet.

        IMHO the vast majority of the stuff we pay highly for is a waste of time. Like almost every lawyer or insurance salesperson or statistician, a lot of doctors, most finance industry people, almost everyone in commercial tech industry (like Google, Netflix, Facebook, Microsoft, IBM etc). Almost all the really good technology we have was developed by cooperating groups of open source developers. Almost all the money making is among people who are creating artificial scarcities by indirectly (through govt action) threatening to lock up or kill their customers if the customers don’t play by rigged rules (like the music, movie, video/TV, book publishing, or pharma, industry). Either that or destroying perfectly good businesses like Sears or Remington or KMart or many local Hospitals by financial techniques previously exclusively used by the mafia (The so called “bust-out” https://doctorow.medium.com/the-long-bloody-lineage-of-private-equitys-looting-798597a4fa30).

        I’m not sure if this has much to do with LLMs but if history is any indicator we will continue to utilize technology and govt to oppress people by force to extract money from them, and continue to poorly pay people who actually move food and goods around or actually produce new technology (like the Julia developers) thereby making it possible for others to live better lives. LLMs and “AI” will likely to be used to dramatically increase the complexity of the laws and rules that carve out those special interests for wealthy and powerful. Most likely climate change will destabilize these power structures, and wealth inequality will reach a level where we’ll have a major “reset” along the lines of WWII within the next 100 years. So, there’s that.

        I’m gonna go walk my dog.

  3. I find it odd that users are surprised or complain when a slight change in the wording of a prompt generates a different LLM response. This is precisely what humans do as well. As an example, Jessica mentions how different synonyms for the words “privacy” and “confidence” change the LLMs response. But my experience in survey research leaves me inured when ever-so-slight (to me) word swaps like this in a survey question or response option can generate different answers. Yes, people of a community share a common language. But each of us also carries a different corpus of experience. So, when answers differ from an LLM, I don’t question the LLM’s accuracy so much as I question our assumptions about the existence of perfectly shared word associations.

    • I think what is surprising is that relative to say, the average English speaker, the phrases that GPT-4 can versus cannot seem to understand are much harder to predict – it seems to understand some very nuanced stuff but completely fails on simpler stuff. Another way to say this is that it seems very hard to form a good mental model of where it will fail relative to a person.

      • I appreciate your points as well as what Logit says. Frankly, I find it hard to form a good mental model for what many people do. But, yes, it is harder to predict LLM misunderstandings than many human ones. I’m not sure that is a defect, however (I can’t help but say this, given that I am currently watching the House speaker voting and am vainly searching for some place I can express my total disgust with that).

  4. And about the male vs female programmer salary example… how do we truly know an LLM is biased if it suggests a different salary for men vs. women? If in reality, the BLS and other sources report that women are indeed paid less than men for reasons that aren’t immediately exist (e.g., length of time in the career, time spent at work, more credentials, or whatever) is the model truly biaaee if it recommends a lower female salary? The salary difference might be embarrassing and raise alarms. It should definitely prompt one to dig deeper and not rely exclusively on chatgpt for salary and promotion decisions. But does the answer mean the LLM is necessarily sexist?

    The fault of the LLM may be that it describes the world we have and not the world we want.

  5. Breaking news: it is easy to trick many people also.

    https://www.nationaljournal.com/s/723017/either-59-or-22-of-republicans-want-the-new-speaker-to-be-loyal-to-trump-which-is-it/?unlock=QK0GRO9YXNJTLX85 (That’s 59% or 22%.)

    “The same pollster yields wildly different responses by changing the question format.”

    (Which is not to say that we shouldn’t be experimenting with LLM to see where they go wrong; we should.) (With people too, if it can be done ethically.)

Leave a Reply

Your email address will not be published. Required fields are marked *