6 ms·
Building a no-code toxicity classifier by talking to GitHub Copilot
- nixpulvis 4y agoFuck people who think they can define speech patterns in datasets like this. Especially since I am required to request permission to view their "Elite" documents. This is some dystopian shit right here. I don't care what fancy models you train on it, or even what funny jokes you make of it. I'm just so done with this.
- arciini 4y agoThis is really pretty impressive. I think Copilot for these kinds of one-off analysis tasks where specific data manipulation rather than structuring abstractions makes a lot more sense. Structuring libraries or building UI requires a lot more understanding of potential users - in that case, writing the requirements is honestly the harder part.
- deleted 4y ago[deleted]
- xodjmk 4y agoPlease add "No-Code" and "Toxicity Classifier" to your toxicity dataset.
- ibeckermayer 4y agoBanger
- esjeon 4y agoNot really no-code. Let's be honest. The OP is taking steps just like how an experienced SW developer would. Copilot simply cut the need for reading through documentations. This doesn't really say that Copilot can replace programmers. p.s. Does anyone know when Copilot will update the insecure example on their website? Or are they just trying to be honest with the possible quality issues with the generated code?
- saurik 4y agoI mean, I would hope they wouldn't try to "update" it by manually changing the results (as, as you note, that would be horribly dishonest).
- Metacelsus 4y agoFrom the title I thought it would be about chemical toxicity.
- ah27182 4y agoThe page is not working anymore, getting a 400 error
- eric4smith 4y agoImpressive BUT. Who is defining toxic speech? Where is that data being taken from? This is the definition of using AI to set what the edges of “speech” should be based on potentially flawed data. This is a clown world.
- r3trohack3r 4y ago> In this example, we’re using the Copilot extension for Visual Studio Code, and a free toxicity dataset that we built; (Emphasis mine) Following that link: > Surge AI is a data labeling platform and workforce. Our labeling team pored over tens of thousands of social media comments to build this toxicity dataset. Each comment was then evaluated by multiple members of our team to determine its severity level.
- bobsmooth 4y agoI feel so sorry for the labeling team. Hope they were paid well.
- Xorlev 4y agoI think you missed the forest for the trees. It isn't the model that matters, it's that copilot is building the classifier from intent (comments). It wouldn't matter if it was classifying flowers instead.
- eric4smith 4y agoNo. I did not miss it. The work is pretty good. My problem is with the dataset and datasets like this overall that sets the tone through AI of what is acceptable and what is not.
- hartator 4y agoNotice that the comments used to generate the code via GitHub Copilot are just another very inefficient programming language.
- dwohnitmok 4y agoThere is nonetheless something extremely valuable about being able to write at different levels of abstraction when developing code. Copilot lets you do that in a way that is way beyond what a normal programming language would let you do, which of course has its own, very rigid, abstractions. For some parts of the code you'll want to dive in and write every single line in painstaking detail. For others `# give me the industry standard analysis of this dataset` is maybe enough for your purposes. And being able to have that ability, even if you think of it as just another programming language in itself, is huge.
- MichaelBurge 4y agoProgramming languages have syntax and semantics, while text-generators are statistical. So I wouldn't call them a programming language, since "having well-defined semantics" is more fundamental than "is often used in an edit->run loop".
- ______-_-______ 4y agoOn the other hand, most code is read more often than it is written, and those comments are very readable!
- bobsmooth 4y agoNotice that the C used to generate the machine code via the compiler is just another very inefficient programming language.
- michalhuman 4y agoWhat makes it inefficient? It is verbose and similar to natural language. Given that code is more often read than written, isn't the code that is easier to understand more efficient?
- Ozzie_osman 4y agoThis is a game-changer, even if it doesn't work 100% of the time. I only infrequently need to use notebooks and dataframes, I'd say once every few months. Frequently enough that I have a vague idea of what I need to do but not frequently enough that I can remember syntax. With this, I don't need to memorize the syntax OR be bottlenecked on looking at documentation or stack overflowing the commands I need.
- qayxc 4y ago> With this, I don't need to memorize the syntax OR be bottlenecked on looking at documentation or stack overflowing the commands I need. In other words: you're celebrating the fact that a tool allows you to become more and more incompetent. I don't have much hope for future generations at this point.
- Aeolos 4y agoPeople said that during the switch from assembly to C, and then again from C to managed languages. Yet, at each point, there are more and better software engineers, solving more and more challenging problems at each step - the modern web would not exist if all we had at our disposable was 80's era assembly. Aren't you at least a bit curious what new possibilities this technology could enable? What new discoveries could e.g. an expert doctor or a biologist achieve given access to programming tools without spending decades learning programming?
- rob74 4y agoI disagree that the problems are more and more challenging - "modern web" applications mostly only do what desktop applications did in the 80s/90s, just with some added complexity due to client/server and trying to use a technology that grew "organically" and wasn't designed for building such applications (HTML/CSS/JS). Also, while the programming languages you mentioned did evolve to higher levels of abstraction, one thing that didn't change was that you still were telling the computer what it should do. Of course, you could still run into problems when the abstractions you were relying on didn't do quite what you were expecting, but now you have Copilot giving you globs of code that supposedly do what you want to do. How are you supposed to check if it really does that if you haven't got the slightest idea about programming?
- vba616 4y agoI thought at first this was a classifier for the toxicity of no-code solutions. For instance, Microsoft Power Automate should rank highly.
- softwarebeware 4y agoI'm out almost immediately. The first comment is more text than the code that it produces.
- lofties 4y agoThink of GitHub copilot as StackOverflow on steroids -- a quick way to write code when you're not sure how to achieve what you're trying to do. After all, "How to parse a CSV file in Python" is longer than "csv.reader(file)" but without knowing that "csv.reader" exists, you have no other way but to tell Google what you need.
- klabb3 4y ago> Think of GitHub copilot as StackOverflow on steroids This is how I already think of co-pilot, but these steroids seem to be mostly for prototyping. SO often have comments and context such as "this works with 98% of browsers", "this isn't recommended, try X instead", "this works but can break library code because it changes the global scope", "this stopped working in version X" etc etc. Context like this can be important to take into account depending on what you're building.
- MichaelBurge 4y agoStart a line with // CAVEATS: // POTENTIAL ISSUES: // Above is deprecated. Use below code instead and ask Copilot to auto-complete.
- klabb3 4y ago// this should never happen
- chockchocschoir 4y agofn classify-toxicity(text: string) { do_work(text) while true {} // this should never happen }
- StopHammoTime 4y agoJust to clarify, it's not really no-code: pseudocode is the new bytecode it would seem and this is just compiling that into usable code. You still need to be able to code and understand what you're doing. You can't just ask simple questions and get complex answers. You still have to be capable of asking complex questions. A common scenario I can think if is where I struggle to remember the name or API of the exact thing I want to do but I know exactly how it works - typing that in and getting a result would improve my workflow, but it's just saving a trip to Google, we're not talking the difference between doing and not doing, just a saving a minute. I would rate the value of this more as interesting rather than useful, simply because as another commenter highlighted it's just easier to write code. It could be useful incrementally but not for everything.
- krsrhe 4y ago
- CallMeJim 4y agoNote that in part of the process, Copilot was the one asking complex questions when the human programmer didn't know how to proceed. Copilot adds tremendous value for someone who knows what they want, but not how to do it. For example, I'm not a great programmer. I'm also a lazy programmer. I had to convert a time to a specific format, in a specific timezone in JS, and I couldn't be bothered looking up documentation for Date.toLocaleTimeString (or is that Date.toLocaleString?). I wrote a comment outlining exactly what I wanted: // given a date in ISO format (and UTC timezone), return the time in hh:mm AM/PM format (and x timezone) and immediately Copilot generated the code I was after. Making something easier can definitely mean the difference between doing and not doing — I've taken on a lot of projects I wouldn't have attempted without Copilot.
- zkldi 4y ago> I wrote a comment outlining exactly what I wanted, and immediately Copilot generated the code I was after. How do you know it was what you were after? Like you said, it could be .toLocaleTimeString or .toLocaleString (or something else). How do you verify that the AI isn't giving you broken/incorrect code? I guess you could check the docs, or run the code yourself, but at that point what's the value add for copilot?
- bmitc 4y agoI don't really understand this. You're not coding directly in the language, but now you're coding in an implicit language provided by Copilot. From what I've seen on Copilot, although it is an impressive piece of tech, all it really points out is that code documentation and discovery is terrible. But I'm not for sure writing implicit code in comments is really a better approach than seeking ways to make discovery of language and library features more discoverable. And I know it sounds silly and like "I had an idea like that once" (see Office Space), but I actually came up with the idea for or at least a similar one to Copilot in an off comment to a coworker back in like 2014 or so. The idea was that as you wrote code, it would display on the side similar code that had been written by others doing the same or similar thing, and then it would allow you automatically upload small processing functions to some sort of cloud library. Same thing for doing autoformatting, although that's less of a concern now that formatters are becoming popular. The context I was working in was visual languages though. I had even started writing a tool during an "innovation week" (that I never showed) that would start visually classifying whether code written in the visual language was "good" or "clean" or not. I never got anywhere with it and mainly just have some diagrams generated from that project that were buggy so that they kind of look like art.
- ShamelessC 4y agoYou "came up" with the idea for intelligent autocomplete? And are you aware that this project actually required big innovations in language modeling and a supercomputer? Because I would say that is far more central to the concept behind the tech than the interface.
- bmitc 4y agoAn idea is not an implementation, and I clearly mentioned it was an offhand comment in a casual conversation. My "idea" was exactly what I described above. Nothing more. I'm sure several had this idea, and Copilot was probably already in development. My comment was just a way to give a personal anecdote. I'm not sure what your point or complaint is. Did you somehow miss the reference to Office Space? It wasn't a serious claim. Just a segue to some thoughts I had.
- bradleybuda 4y agoSo, has anyone asked Copilot to write a better Copilot yet?
- hoosieree 4y ago// generate 1e13 different versions of bubble sort and add to db
- pech0rin 4y agoechoing a bunch of comments but this seems sort of like a nightmare. its like the classic “dont use comments that are exactly what the code is doing”. basically you are requiring writing this type of boilerplate comments which are completely useless but are now so the machines can write the code for you. i guess if you could have some tool that auto-removes these comments afterwards it wouldn’t be terrible but i just see this as a way to have people completely forget apis and then not actually be able to find more powerful tools in a language just living on the rails that copilot provides for you. overall seems like a step backwards, especially if newer devs use this as a crutch when jumping in. now we have a generation of devs who dont actually understand the way things work. i guess stack overflow has a similar problem but at least there people provide documentation, explanation, and helpful links. this just force feeds you some code. i dont see this as a positive movement for our industry as a whole
- aaaaaaaaaaab 4y ago>now we have a generation of devs who dont actually understand the way things work. Can’t wait for this to be true! I will be treated as a demigod compared to them. Job security for life!
- krsrhe 4y ago
- linkdd 4y agoCan we ask Copilot to write a proof for the collatz conjecture? or P=NP?
- achenet 4y agowe could ask, but would have no garantee such a proof would be correct.
- tomerv 4y agoThe first comment asks Copilot to import all the libraries needed for a toxicity classifier, and it imports libraries such as re (regex engine) and nltk (natural language toolkit). But what if I wanted a classifier for toxic chemicals and not toxic speech? That was my first thought when I saw "toxicity" in the title. I'm now imagining a very frustrated junior developer a few years from now trying to argue with Copilot to write code for a classifier for chemical compounds, but it just spits out code for classifying text.
- blackoil 4y agoLike googling is an essential skill for developers. In few years if Copilot deliver its promise, navigating it would be treated the same. You may also have an interview round wherein optimization would be how quickly can you get Copilot to write the expected code.
- junon 4y agoIf this is what software engineering turns into, put a bullet through my head please.
- Aeolun 4y agoYou can ask copilot to do it for you!
- madrox 4y agoIt's not that far off today from how junior engineers treat stack overflow. There's just fewer intermediate steps.
- KMag 4y agoI think we all cargo-cult our way into programming and then over decades get better and better understanding of what we're doing and why. I remember being 7 years old and not really understanding the AppleSoft BASIC manual. I memorized the variable names in the code examples, not realizing I could name variables whatever I wanted. A$, B$, LEFT_FOOT$. The latter was there to be obvious that one could name variables whatever one wanted, but 7 year-old me didn't understand. I remember talking to an older kid on the school bus whose father worked for IBM, and the confused look on his face when I started rattling off my list of memorized variable names. I can still picture his face, but I forget his name. I'm pretty sure he was Mike. Thanks for straitening me out, Mike (Schmidt?). At least we're getting more effective cargo cults.
- abeppu 4y agoWe're all focusing on the weaknesses of co-pilot (the comments can be longer than the code produced; you need to understand code to know when to elaborate your comment, etc). But also ... what do you need to know to recognize that the concept of a 'toxicity classifier' is likely broken? We can do _profanity_ detection pretty well, and without a huge amount of data. But with 1000 example comments, can you actually get at 'toxicity'? Can you judge toxicity purely from a comment in isolation, or does it need to be considered in the context in which that comment is made? Maybe you don't need to know about python, but if you're building this, you should probably have spent some time thinking and grappling with ML problems in context, right? You want to know that, for example, the pipeline copilot is suggesting (word counts, TFIDF, naive Bayes) doesn't understand word order? Or to wonder whether it's tokenizing on just whitespace, and whether `'eat sh!t'` will fail to get flagged b/c `'shit'` and `'sh!t'` are literally orthogonal to the model? More people should be able to create digital stuff that _does_ things, and maybe copilot is a tool to help us move in that direction. Great! But writing a bad "toxicity classifier" by not really engaging with the problem or thinking about how the solution works and where it fails seems potentially net harmful. More people should be able to make physical stuff too, but 3d-printed high-capacity magazines don't really get most of us where we want to go.
- BeefWellington 4y agoA few years ago I did some work with IBM's Watson Twitter integration. One of the fun things you could do was sentiment analysis. It was reasonably accurate for the extremes but anything in the gray area would be wildly off. A politely worded tweet that was scathing would come across high on the positive sides of the scale, whereas a perfectly reasonable sentence that included profanity as used in a quote would immediately be high on the negatives. This part from the article made me chuckle, because IMO the author fell for some of the most basic language processing smoke & mirrors: …so we’ll give it some examples. When generating the array, it even creates the ideal variable name and escapes the quotations. Here, it generates toxic_comments as a variable name, when the instructions were: # create an array with the following toxic comments: [etc] This is pretty basic language parsing stuff that might have been kicking around awhile. I think the most basic english language parser could output something along the lines of what was suggested, given an understanding of what valid Python should look like. While impressive, it's not nearly as interesting or good as the rest of the work being done. Copilot appears no different to most ML models out there. Poor and incomplete training data will yield ok results for popular things but as soon as you ask for edge cases it will fall apart like Siri trying to understand a Scottish accent. Eventually it might get there with enough good representative training data but it's unclear to me how long that will take. If it tracks with speech processing models it might take decades plus. Another consideration is that because the training data is being done using github public repos (at least last I read), it's likely that it's ripe for abuse. If that's still how they're doing it I'm looking forward to the TEDTalk in two years from a researcher who "hacked" the copilot AI by polluting its training data.
- holografix 4y agoThis would be awesome for crap I don’t want to learn like CSS
- stitched2gethr 4y agoThis is actually pretty impressive. More so than I expected, and I sincerely hope this opens the door to simple solutions for those who are still learning or don't code often. That said, this isn't the robot that replaces us, obviously. Making the process of getting to 80% faster is better for everyone, but the last 20 is tough and anything further needs real expertise. I like how promising this is for the masses.
- fsargent 4y agoI seriously thought that GitHub CoPilot was suggesting how to find new kinds of sarin gas. https://www.theverge.com/2022/3/17/22983197/ai-new-possible-chemical-weapons-generative-models-vx https://www.theverge.com/2022/3/17/22983197/ai-new-possible-... How long until it does?
- eurasiantiger 4y agoYou could already ask it to do this.
- wojcikstefan 4y ago1. This is not “no-code”. You still have to read & understand the code Copilot generates. 2. I’m very skeptical of a small group of people reading a bunch of online comments and deciding what is “toxic” and “non-toxic”, even more so when it’s done with no clear definitions/guidelines. As their GitHub repo [0] says: > Rather than operating under a strict definition of toxicity, we asked our team to identify comments that they personally found toxic. [0]: https://github.com/surge-ai/toxicity https://github.com/surge-ai/toxicity
- kcorbitt 4y agoWhat funny timing! Just this week I've actually been working on an open source VS Code extension that uses OpenAI's new code edit API[1] to let you write or edit code in your IDE by typing instructions. And as a bonus related to the article title, it literally lets you talk to your editor (ie you can press the keyboard shortcut and then give edit commands by voice[2]). I've been leaning on it heavily for the last few days and the setup feels really productive! If you want to try it out you can install it here: https://marketplace.visualstudio.com/items?itemName=clippy-ai.clippy-ai https://marketplace.visualstudio.com/items?itemName=clippy-a... You can also find the full source code here: https://github.com/corbt/clippy-ai/tree/main/vs-code-extension https://github.com/corbt/clippy-ai/tree/main/vs-code-extensi... I'd love feedback! [1]: https://openai.com/blog/gpt-3-edit-insert/ https://openai.com/blog/gpt-3-edit-insert/ [2]: I just wrote the voice command interface yesterday and it's still highly experimental. Relies on having ffmpeg installed on MacOS and doesn't work with all audio setups yet. But there's a clear path to making it more robust.
- jwithington 4y agothis is cool! to clarify, it's different than the existing Copilot extension because this lets you edit existing code and uses voice commands?
- junon 4y agoAs with most harmful speech classifiers (even classic models) this most likely won't catch the more passive aggressive remarks. Those worded innocently but imply something terrible. I've had a 100% success rate getting these sorts of models to tell me asking someone to "kindly end their own life" is not rude, toxic or harmful.
- hombre_fatal 4y agoThis is absolutely insane. I had no idea Copilot was this good. The negativity here just seems like sour grapes or weird goal posts. Sure, it makes mistakes and needs verification. But know what also makes mistakes and needs verification? All the code I already manually write as I tediously ratchet towards a solution. Removing some cycles from that process is a win. Just stubbing out close-enough boilerplate is a win by itself, like setting up an NLP pipeline or figuring out which menagerie of classes need to be instantiated and hooked up together to do basic things in some verbose libs/langs.
- Mountain_Skies 4y agoEven though it is based on mostly human written code, Copilot makes mistakes that are different from the type human coders typically make. It will take a different skill set to detect and correct the errors made by systems like Copilot. The same is true for self-driving cars. This doesn't mean that we shouldn't use these technologies, just that there will be adaptations to our behavior we'll need to make if we want to make use of them.
- fn1 4y ago> Even though it is based on mostly human written code, Copilot makes mistakes that are different from the type human coders typically make. Can you give an example for this?
- Satam 4y agoProbably not what OP intended but here's what I encountered. When autocompleting code for a Pythonic database query it would finish something like "query.all()" as "query.all().delete()". Meanwhile, as a programmer, I'm usually quite vary of deleting all the records from a database unless I'm very sure that's what I want.
- ShamelessC 4y ago> The negativity here just seems like sour grapes or weird goal posts. Indeed. Every negative comment I have seen here has been a shallow dismissal by someone who clearly hasn't engaged with the tool. I'm not sure why people here are so primed to shit all over anything potentially innovative, seemingly even without background knowledge. Like, is there something inherently offensive to coders about a model that threatens to do their job? Or is it just years and years of people getting burned by previous "AI" projects without knowing that this one is actually rather impressive and comes from good research? Keep shallow dismissals to yourselves people. It's in the site's rules.
- dusted 4y agoThis comment will of course be down voted, I'll attribute this to selection bias caused by the headline of the article. You can't classify a comment as boolean toxic, toxicity does not exist in a vacuum. To extend the analogy from it's biological counterpart, toxicity depends on the organism. You should never just a piece of text in isolation and draw any conclusion about it. It must understood in context, both that of the subject, the recipient and the sender.
- ShamelessC 4y agoI mean, what you're saying just isn't really directly on-topic. The article's focus is a a copilot tutorial, clearly meant to be illustrative rather than literally used in production. So it comes across like you're criticizing the article for doing something it isn't really concerned with doing to the degree you are expecting. Does that make sense?
- dusted 4y agoIt does make sense. However, the framing of the tutorial is clearly about using automated censorship at scale. Someone is going to roughly copy-paste this into some forum software and call it a day.
- IshKebab 4y agoYou'll be downvoted because that is obvious, irrelevant and has no practical consequences.
- account42 4y agoIf I had to guess, most downvotes GP got were for "predicting" downvotes.
- dusted 4y agoI've found that sometimes, "predicting" downvotes fails, and the comment is upvoted, it seems to correlate more to whether people agree with the sentiment of the rest of the comment, but I agree that the prediction could influence the outcome.
- rogue7 4y agoThis is impressive, Copilot knows scikit-learn better than the data scientist that I am.
- chronolitus 4y agoReminds me of this post by Scott Aaronson: https://scottaaronson.blog/?p=6288 https://scottaaronson.blog/?p=6288 "Forget all that. Judged against where AI was 20-25 years ago, when I was a student, a dog is now holding meaningful conversations in English. And people are complaining that the dog isn’t a very eloquent orator, that it often makes grammatical errors and has to start again, that it took heroic effort to train it, and that it’s unclear how much the dog really understands."
- deadbeeves 4y agoBecause those points are key to whether the technology can (or is worthwhile to) be evolved further. Is a dog that just holds conversations without any understanding what we want, or do we want the dog to eventually take on more interesting tasks? Can we get there with this method or not? How much effort would it take? Technology that can only make you go ooh and ahh is pretty useless.
- amelius 4y agoThis works because there's a lot of ML code out there, and it's all very much the same.
- MrYellowP 4y agoI'm not sure people understand how utterly dystopian and fascist this is. It's like people believe that this is a good thing, instead of understanding how totalitarianism is spreading literally everywhere. "In the name of what's Good & Right, you have to behave how we want you to ... or else."
- spyremeown 4y agoWhat are you talking about, dude? How is an AI that generates code fascist?
- boredumb 4y agoThe last thing this world needs is automation around people calling things toxic or problematic.
- DeathArrow 4y agoI would like to see a project adding together capabilities of both Autopilot and Intellicode. Copilot uses GPT-4 and GitHub project for training and is giving suggestions based on few lines, Intellicode is reading the whole project and is giving suggestions based on that.
- TauNeutrino 4y agoIt's an AI writing another AI, the miracle of guided reproduction! As programmers we should appreciate the subtle meta in that. It is also highly symbolic that the first AI (copilot) was created to save humans from repeating toil, while the second (classifier) is about controlling and limiting us. I believe the author chose to apply his method to this particular example intentionally for the two above points, not because of the hype of toxicity.
- Loeffelmann 4y agoI've been using copilot for a bit now and it's honestly really impressive. I was skeptical at first and didn't really believe all the praise but it works so well. You still have to understand what the code is doing but more often then not copilot spits out a out of the box working solution. It is phenomenal at writing tests. I can pretty much tell it "write tests for this function" and it will do it with surprising Quality and maybe even goes through cases I haven't thought about. I think this technology will really shake up how we code.