Alvaro Cintas Profile picture
Aug 26 12 tweets 7 min read Twitter logo Read on Twitter
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

Aug 19
Many people are talking about Claude being a better option than ChatGPT.

So I decided to put them to the test!

- Reasoning
- Simple math
- Coding
- Creativity & more

Here are my findings: Image
✍️ Before we start:

- This is by no means a conclusive/thorough study. This was done for fun testing different small questions just to see how they would do.

- I’ll be using ChatGPT with GPT-4 (let’s call it ChatGPT+)

- I didn’t add here the questions that both got correct, which were A LOT (more numbers later).

- Some of these models 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.
1. FEATURES

🟢 ChatGPT+:

- Plugins
- Code Interpreter
- Custom Instructions

🟤 Claude:

- Completely free
- Context window is 100k
- It can read files free

I consider this a TIE since these are more a personal preference.

Here is a video of both showing some features 👇
Read 10 tweets
Aug 17
Do not use ChatGPT for references.

It provides fake citations and out-of-date information.

Instead, there is an AI-powered app that is designed to help you in your literature review!

Here is everything you need to know and how to use it FREE: Image
The tool I will be covering is called R Discovery (sponsored).

It is an app that you can use directly on your phone. To download, you can simply search for “R discovery” on the App Store or Google Play Store.

🔗 You can download it here: https://t.co/K1i6KT4gRWapp.adjust.net.in/13ixgrdr
Image
1. SETTING IT UP

Once you download the app:

- Select a goal
- Choose the areas you are interested in
- Add topics
Read 8 tweets
Aug 12
Microsoft Designer is truly amazing.

It turns your words into INCREDIBLE designs in seconds using AI.

Here is a tutorial to create one for free 🧵:
1. ACCESSING THE APP

To access the app:

- Go to
- Click on “Get started for free”
- And login with your email https://t.co/DdZni7xMswdesigner.microsoft.com
2. GENERATING FIRST DESIGN

Once you login, you can just type the type of design you want.

To create the images, it uses DALL•E.

If you want to modify the size or have an image to add, you can also do that.

The best thing? It also generates VIDEOS!
Read 7 tweets
Aug 10
BREAKING: Custom Instructions are rolling out to all ChatGPT users!

It allows you to add preferences or requirements for its responses.

Here are 8 incredible examples of what is possible (🧵 Plus tutorial): Image
✍️ QUICK TUTORIAL (skip this if you just want to see the examples):

1. Click on the three dots (bottom-left side)
2. Select “Custom Instructions”
3. Enter information to let ChatGPT know how to respond.

Everyone should now have access to it, except EU and UK (rolling out soon)!
1. Make ChatGPT go straight to the point (no more “As a large language model…”) by @JeremyNguyenPhD
Read 11 tweets
Aug 7
ChatGPT isn’t the best at academic writing.

There is an AI-powered assistant specifically designed for that.

Here is a tutorial & how to try FREE [🧵 Super useful for non-English speakers]: Image
The tool I will be talking about is Paperpal @teampaperpal (sponsored).

Paperpal takes your academic writing to the next level:

- Understands context
- Identifies complex writing errors
- Suggests improvements
- Paraphrases
- Translates
- & more!

Let’s look at how to use it 👇 Image
1. ACCESS THE APP

To access the app, you need to go to:

There, click on “Get Started”.

Once you register for free, you can either start a new document or upload a document. https://t.co/CjX2XDQcXepaperpal.com
Read 9 tweets
Aug 5
AI is a great area to specialize in.

And you can now start for FREE, this very weekend!

Here are 7 free courses that offer certificates [🧵 with links]: Image
1. LinkedIn & Microsoft: Career Essentials in Generative AI

This course helps you discover the skills needed to apply generative AI in your career.

🔗 https://t.co/GPcjCkI139linkedin.com/learning/paths…
2. Google’s Generative AI Learning Path

10 free short courses that teaches you everything you need to know about AI.

Course 4 is to earn a skill badge!

🔗 https://t.co/okugTiBG9Fcloudskillsboost.google/journeys/118
Read 9 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 on Twitter!

:(