Have people played with Bard & ChatGPT?


Recommended Posts

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

You get the following response:

 

Quote

I'm sorry, but rewriting the entire Linux kernel's cpu.c file in Rust is beyond the scope of what I can do as a language model. Additionally, the cpu.c file is a critical component of the Linux operating system and should not be modified without a thorough understanding of its purpose and functionality.

That being said, I can give you a brief overview of what the cpu.c file does. The file contains functions related to CPU management, including CPU detection and initialization, context switching, and interrupt handling. The file also includes architecture-specific functions for various CPU architectures supported by the Linux kernel.

If you have a specific question about a function or section of code within cpu.c, I would be happy to try and help.

 

Yes, people have indeed played with Bard and ChatGPT! Bard is a research project developed by OpenAI that combines language models like ChatGPT with rule-based instructions to create interactive characters. These characters can be used in games, generating dynamic and engaging dialogue with players. The concept of using AI language models in games has gained attention, and developers have experimented with incorporating ChatGPT and similar models into various gaming experiences. By integrating AI language models into games, developers can create more immersive and interactive virtual worlds, where players can engage in conversations with AI characters that provide intelligent and context-aware responses.  

On 07/05/2023 at 17:39, branfont said:

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

You get the following response:

 

 

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

On 11/05/2023 at 12:21, zikalify said:

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

On 11/05/2023 at 19:29, branfont said:

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

There's no way that code is complete, it's too short. Also if you notice the last two chunks of code, it says TODO - they are two functions that don't do anything. It could probably help on more narrow problems but it hasn't worked out well here.

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

On 11/05/2023 at 16:49, zikalify said:

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

My programming knowledge wasn't very good & it's decades old: BASIC. On the Commodore 64. I don't even remember any BASIC.

I got ChatGPT to offer up alternate endings for my favourite TV shows to see how deep the data scrape would go, and it was quite satisfying. Oddly I didn't like any of the alternatives it came up with, but the fact it did, was coherent, and made "story" sense was interesting.

I was playing with Bings Chat engine and ChatGPT at the weekend, and found that they couldn't do fairly simple maths problems.

Example of a ChatGPT session (paraphrased)

Quote

 

Me: How many ways are there of dealing 7 cards from a deck for 104 cards?
(The answer is 21,243,342,120 BTW)

ChatGPT: You can calculate this by using the formula 104!/(7!(104-7!))  (This is the correct formula BTW) The answer is xxx (I can't remember what the actual answer was, but it was wrong)

Me: No, that's wrong

ChatGPT: Sorry, you're right, the actual answer is yyy (still wrong)

Me: No, you're still wring.

ChatGPT: Sorry, you're right, the real answer is zzz (still wrong)

Me: No you're wrong. The answer is 21,243,342,120.

ChatGPT: Oh, I'm sorry, you're right.

 

A similar chat with Bing Chat was even worse. Bing insisted that answer was something like 1.7 Quintillion (which is 18 zeroes). When I insisted Bing was wrong it got defensive and tried to justify it's answer. I caught it in a blatant error, which it couldn't admit to. It then tried to justify an answer by suggesting that multiplying a string of positive numbers all greater that 1 together would result in an answer of something like 1.6x10^-315! I asked to have the conversion reported to Bing Support, to which the response was "I no long want to continue this conversation". Chat ended.

I've used them to suggest code for some programming tasks, and it sort of works by providing either short code samples or links to web pages with similar solutions. Barely better than a typical Google search.

On 5/11/2023 at 8:55 PM, macoman said:

This will blow your mind guys... chatgpt in a whole different level... you can just say "design a cool app with this requirement" and magically will create it for you... no coding require.

https://picoapps.xyz/metagpt https://carminho.com.pt/casino-online/gaming-club

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

On 18/05/2023 at 02:38, pololy07 said:

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

Remember that the link to that gpt is the first link: https://picoapps.xyz/metagpt

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

On 18/05/2023 at 05:53, InsaneNutter said:

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

I think AI will make the job of bloggers irrelevant in the future. You just need to ask AI and will write for you!

  • 2 months later...

Bard no, ChatGPT yes...

I asked it to rewrite my resume to fit & highlight my qualifications for a particular job title and it did a fairly good job, definitely better & faster than what I had already written :)

But then I asked it to write some complex formulae for a spreadsheet I am working on, and again, it was considerably faster, but was only about 75% correct, because it overlooked a few key arguments, which of course threw off the resulting calculations by quite a large amount...

So I give it an E for effort, and a real-world performance rating of 6/10 for now...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • The laptop in the bedroom is an Acer with i7-10510U CPU. Acer's website states they will not be upgrading it so I had little choice other than disable secure boot. I know next to nothing on these matters so hopefully it will be fine.
    • GitHub removes manual model selection from Copilot free and student plans by Karthik Mudaliar GitHub is removing the ability to manually select an AI model from its Copilot Free and Student plans, making its automatic routing system the default and only way to choose a model. This means users on these tiers will no longer be able to deliberately select a particular OpenAI, Anthropic, Google, or Microsoft model for a task. In its announcement, GitHub said Copilot Auto will dynamically choose what it considers the best model for each request. Free and Student accounts will retain access to models from multiple families, although the available selection will continue to depend on the restrictions attached to each plan. GitHub did not identify a fixed pool of models that Auto will always use, and its documentation warns that model availability can change over time. GitHub describes Auto as more than a random fallback system. On supported surfaces, its task-optimization technology evaluates the complexity of a request alongside real-time information about model health and availability. Straightforward prompts can be routed to faster and less expensive models, while more demanding coding tasks may be sent to higher-cost reasoning models. The company says this approach should reduce rate limiting, latency, and failed requests. Auto generally selects one model along natural prompt-caching boundaries rather than repeatedly switching models during a session, as GitHub found that mid-session changes increased costs without producing sufficient improvements in output quality. Users can still check which model generated a response. In Copilot Chat, the information appears when hovering over an answer, while Copilot CLI and the Copilot cloud agent display the selected model alongside their output. Auto is available in Copilot Chat, Copilot CLI, and the cloud agent, with the exact implementation and release status varying between supported development environments. The latest restriction follows several months of adjustments to Copilot’s individual plans. GitHub temporarily halted new Pro, Pro+, and Student subscriptions in April as it sought to manage demand and service reliability. It later introduced token-based billing and began gradually reopening individual-plan registrations on June 17. Alongside the picker change, GitHub is retiring the “Preview” label from Microsoft-developed models. It argues that the label is no longer necessary because Auto handles model routing and models are continuously updated behind the scenes.
    • Look up 'inflation' kid. Ask an AI for the numbers between both games.
    • Google reportedly set to lose two key Gemini and DeepMind researchers to Anthropic by Karthik Mudaliar Google is reportedly preparing to lose two more prominent artificial intelligence researchers, with Gemini contributors Jonas Adler and Alexander Pritzel planning to join rival AI developer Anthropic. According to a report from Bloomberg, both researchers are viewed internally as important contributors to Google’s flagship Gemini model family. Adler worked on Google’s AI coding efforts, while Pritzel was involved in the process used to train AI systems. Neither company has publicly confirmed the moves. The report also does not say when the researchers will formally leave Google or what positions they will hold at Anthropic. Training a large AI model requires decisions covering its architecture, data preparation, distributed computing infrastructure, and post-training methods that shape how the finished system behaves. Researchers with experience operating at the scale of Gemini are consequently difficult to replace quickly. Both Adler and Pritzel have previously contributed to Google DeepMind’s scientific research as well. They are listed among the authors of the company’s work on expanding AlphaFold protein-structure predictions across entire proteomes, alongside AlphaFold researchers including John Jumper. The reported departures arrive shortly after another important change within Google’s Gemini organization. Gemini co-lead Noam Shazeer is leaving Google for OpenAI, after returning to the search company in 2024 through its deal with Character.AI. Shazeer is particularly well known as one of the authors of the Transformer paper, whose architecture became the foundation for most modern large language models. Anthropic, meanwhile, has been recruiting recognizable figures from other leading laboratories. OpenAI co-founder and former Tesla AI director Andrej Karpathy joined Anthropic’s pre-training team in May. His move, followed by the reported recruitment of several Google researchers, suggests Anthropic is strengthening the research teams responsible for the core capabilities of future Claude models rather than concentrating solely on product and enterprise sales. The competition is complicated by the companies’ extensive commercial relationships. Anthropic competes directly with Google’s Gemini models, but it also relies on Google as an infrastructure partner. In April, Anthropic announced an expanded agreement with Google and Broadcom covering multiple gigawatts of next-generation Tensor Processing Unit capacity. TPUs are Google-designed accelerators used to train and run large AI models. via Bloomberg
    • This article makes my head hurt. Lots of confusing words
  • Recent Achievements

    • Dedicated
      Scoobystu earned a badge
      Dedicated
    • First Post
      Tom Schmidt earned a badge
      First Post
    • One Month Later
      D0nn13 earned a badge
      One Month Later
    • Rookie
      +ChiefOfNeo went up a rank
      Rookie
    • One Year In
      Tom Schmidt earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      461
    2. 2
      +Edouard
      177
    3. 3
      PsYcHoKiLLa
      124
    4. 4
      Michael Scrip
      79
    5. 5
      Xenon
      76
  • Tell a friend

    Love Neowin? Tell a friend!