Alvaro Cintas Profile picture
Aug 26, 2023 12 tweets 7 min read Read on X
Everyone is talking about Code Llama.

A large language model fine-tuned for coding tasks.

So I had to put it to the test against ChatGPT!

Here are my findings [THREAD]: Image
✍️ Before we start:

- This is by no means a conclusive/thorough study. This was done for fun testing different LeetCode coding questions (you can try on your own to practice!) just to see how they would do.

- I’ll be using ChatGPT with GPT-3.5 and Code Llama Instruct - 34B through Perplexity.

- Most of the time Perplexity was printing the code with no indentations, I added the indentations manually.

- They might do okay if you ask them a second time or express the question differently. However, I just wanted to test them in a single prompt with no variations.
QUESTION 1

“Use Python. You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.

Return the merged string.

Example 1:

• Input: word1 = "abc", word2 = "pqr"
• Output: "apbqcr"

🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 2

“Use Python. Given a string s, reverse only all the vowels in the string and return it.

The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.

Example 1:

Input: s = "hello"
Output: "holle"

🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 3

“Use Python. Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

Note that you must do this in-place without making a copy of the array.

Example 1:

Input: nums = [0,1,0,3,12]
Output: [1,3,12,0,0]”

🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 4

“Use Python. You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.

Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise.

Example 1:

Input: flowerbed = [1,0,0,0,1], n = 1
Output: true

Example 2:

Input: flowerbed = [1,0,0,0,1], n = 2
Output: false”

🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 5

“Use Python. Given an input string s, reverse the order of the words.

A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.

Return a string of the words in reverse order concatenated by a single space.

Note that s may contain leading or trailing spaces or multiple spaces between two words. The returned string should only have a single space separating the words. Do not include any extra spaces.

Example 1:

Input: s = "the sky is blue"
Output: "blue is sky the"”

🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 6

“Use Python. Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.

Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

Example 1:

Input: s = "leetcode", k = 3
Output: 2
Explanation: "lee", "eet" and "ode" contain 2 vowels.”

🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 7

“Use Python. You are given a string s, which contains stars *.

In one operation, you can:

Choose a star in s.
Remove the closest non-star character to its left, as well as remove the star itself.
Return the string after all stars have been removed.

Example 1:

Input: s = "leet**cod*e"
Output: "lecoe"”

🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 8

“Use Python. Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.

Example 1:

Input: temperatures = [73,74,75,71,69,72,76,73]
Output: [1,1,4,2,1,1,0,0]”

🟢 ChatGPT: +1
🔵 Code Llama: +1
RESULTS

🟢 ChatGPT: 8/8
🔵 CodeLlama: 5/8

Notes:

The questions where selected at random. I usually pick questions that are short and easy to understand.

Have you tried Code Llama? How is your experience compared with ChatGPT? 👇
If you enjoyed it, it would be great if you could like & retweet the first tweet :)

Also, you can subscribe for free to , where I share AI tutorials, news, and tools. todaystechtalk.beehiiv.com

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alvaro Cintas

Alvaro Cintas Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @dr_cintas

Apr 25
What a crazy week in AI 🤯

- Grok’s AI Vision
- Genspark AI Slides
- Perplexity Assistant
- OpenAI gpt-image-1
- Tavus SoTA lipsync model
- Dia SoTA speech AI model
- Dreamina AI's Top AI Image
- ChatGPT Deep Research Mini

Here's EVERYTHING you need to know:
1. Grok Vision launches with multimodal capabilities, letting users point their phone cameras at objects or environments for real-time analysis.

This comes alongside multilingual audio support and real-time search capabilities.
2. Genspark introduces AI Slides, transforming presentation creation with a powerful agentic approach.

Its AI researches topics, generates supporting visuals with images and charts, and can transform various document types into polished slide decks.
Read 10 tweets
Apr 24
This is such a powerful AI coding workflow.

You can now use Cursor or Windsurf for coding, and let CodeRabbit’s AI agent refactor messy code, help you debug, and find security vulnerabilities.

Here’s how:
1. Visit , click "Sign in with GitHub”, and authorize CodeRabbit coderabbit.ai
2. Go to your dashboard and click "Add Repositories"

Then, select the repositories you want to enable
Read 4 tweets
Apr 23
Genspark might be the best AI agent I’ve tried yet.

It can agentically conduct research, create web pages, generate videos, and even have the AI call and make reservations for you.

10 powerful use cases:
2. AI Slides (@genspark_ai just launched this)

This Super Agent conducts research and creates polished slides and icons, and users can also edit them. 

To try it out, you can go here: genspark.ai
3. Create minute-long South Park Episode about recent news
Read 12 tweets
Apr 23
🚨BREAKING: Top AI image model just launched.

It’s called Seedream 3.0 by Dreamina AI and it ranks #1 at creating photorealistic images up to 2k resolution.

Dreamina AI can also upscale, inpaint, expand and even generate videos.

It’s now fully available. Link to try free below Image
This is the link to access @dreamina_ai:

First, select where it says “Image Generator” dreamina.capcut.com/ai-tool/home/?…
Next, enter your prompt, select “Image 3.0”, and choose your aspect ratio.

Click “Generate” to get four different visuals.
Read 8 tweets
Apr 21
AI videos are getting scary good.

So I tested some of the hardest prompts for all the major leading models:

• Kling 2.0
• Sora
• Runway Gen-4
• Google Veo 2

10 side-by-side examples:
2. A lion driving an open jeep in the tanzania safari
3. The abominable snowman and bigfoot in the snow sitting on chairs across from each other in a jam session with a guitar and a violin.
Read 11 tweets
Apr 17
What a crazy week in AI 🤯

- Kling 2.0 AI video
- Canva Visual Suite 2.0
- Microsoft Copilot Vision
- Grok Studio and Memories
- ChatGPT 4.1, o3, & o4-mini
- OpenAI’s new coding agent
- ByteDance Seaweed AI video
- Claude Autonomous Research

Here’s EVERYTHING you need to know:
1. Kling AI released its new model Kling 2.0.

This launch features improved prompt understanding, enhanced character motion dynamics for more natural fluid movements, and a Multi-Elements Editor for easier video editing.
2. Canva unveiled Visual Suite 2.0, their biggest product launch since founding.

New AI features include the ability to create everything from documents and presentations to websites in a single design. Image
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(