Friday, June 21, 2024

An Exponential Leap: The Emergence of AGI - Machines That Can Think

Tech companies are in a rush. They're trying to lock in as much electricity as they can for the next few years. They're also buying up all the computer components they can find. What's all this for? They're building machines that can think and referring to the tech as Artificial General Intelligence, or AGI.

On June 3 Ex-OpenAI researcher (yeah he was fired) Leopold Aschenbrenner published a 162 page interesting document titled SITUATIONAL AWARENESS The Decade Ahead. In his paper Aschenbrenner describes AGI as not just another incremental tech advance – he views it as a paradigm shift that's rapidly approaching an inflection point.


I’ve read the whole thing - here's my short list of highlights by topic.


Compute Infrastructure Scaling: We've moved beyond petaflop systems. The dialogue has shifted from $10 billion compute clusters to $100 billion, and now to trillion-dollar infrastructures. This exponential growth in computational power is not just impressive—it's necessary for the next phase of AI development.


AGI Timeline Acceleration: Current projections suggest AGI capabilities surpassing human-level cognition in specific domains by 2025-2026. By the decade's end, we're looking at potential superintelligence—systems that outperform humans across all cognitive tasks.


Resource Allocation and Energy Demands: There's an unprecedented scramble for resources. Companies are securing long-term power contracts and procuring voltage transformers at an alarming rate. We're anticipating a surge in American electricity production by tens of percentage points to meet the demand of hundreds of millions of GPUs.


Geopolitical Implications: The race for AGI supremacy has clear national security implications. We're potentially looking at a technological cold war, primarily between the US and China, with AGI as the new nuclear equivalent.


Algorithmic Advancements: While the mainstream still grapples with language models "predicting the next token," the reality is far more complex. We're seeing advancements in multi-modal models, reinforcement learning, and neural architecture search that are pushing us closer to AGI.


Situational Awareness Gap: There's a critical disparity between public perception and the reality known to those at the forefront of AGI development. This information asymmetry could lead to significant societal and economic disruptions if not addressed.


Some Technical Challenges Ahead:

- Scaling laws for compute, data, and model size

- Achieving robust multi-task learning and zero-shot generalization

- Solving the alignment problem to ensure AGI systems remain beneficial

- Developing safe exploration methods for AGI systems

- Creating scalable oversight mechanisms for increasingly capable AI

An over reaction by Aschenbrenner?  Some think so. Regardless - this stuff is not going away and as an educator and technologist, I feel a responsibility to not only teach the tech but also have students consider the ethical and societal implications of this kind of work. The future isn't just coming—it's accelerating towards us at an unprecedented rate. Are we prepared for the AI  technical, ethical, and societal challenges that lie ahead?

Wednesday, June 19, 2024

How Is Battery Percentage Measured On My Device?

I get this question often - how is battery percentage measured and calculated by devices like our
phones, leaf blowers, electric cars, etc?  

It turns out most modern Battery Management Systems (BMS) use a combination of four variables to estimate the remaining charge in a battery.

 

1.    Voltage Measurement: Used to provide quick and direct State Of Charge (SOC) estimates  but can be inaccurate due to load variations. There are two measurements typically  considered:

  • Open-Circuit Voltage (OCV): This measures the voltage when the battery is not under load. Each battery type has a characteristic voltage curve that relates voltage to SOC.
  • Under-Load Voltage (ULV): This measures the voltage while the battery is under load. Compensation is required to account for the voltage drop due to internal resistance. 

2.    Coulomb/Charge Counting:  Precise over short periods but can drift over time due to measurement inaccuracies.

  • Coulomb/Charge Counting involves tracking the current flowing in and out of the battery. By integrating the current over time, you can estimate the total charge added or removed. This method needs a known initial state of charge to be accurate.      

3.    Impedance Tracking: Provides additional data to refine SOC estimates but requires complex algorithms and computations.

  • Impedance Tracking uses the battery's internal impedance (reciprocal resistance) which changes with the state of charge. By measuring the impedance, the state of charge can be estimated.

4.    Temperature Compensation: Battery performance and voltage readings can be significantly affected by temperature. 

  • Temperature sensors are used to adjust the SOC calculations.

Battery Capacity


Battery capacity C for a new battery is a given and specified by the battery manufacturer in ampere-hours (Ah) or milliampere-hours (mAh) units, depending on the size of the battery. As an example, the iPhone 15 Pro is equipped with a single battery rated at 3274mAh.  If you are wondering about your Tesla or Prius - batteries are wired in parallel – for example a 2020 Long Range Tesla Model 3 battery pack has 46 cells in parallel with each cell rated at 5 Ah. So that Tesla battery pack has about 46x5 Ah = 230 Ah capacity. Over time, battery capacity will decrease.

 

Some Variables


Let’s look at a couple of simple calculations used by our devices to calculate battery charge/percentage. Before we look at the formulas, let’s identify some variables used in the calculations.

 

Initial Calibration:

  • Battery starts fully charged (100% SOC).
  • OCV is measured to establish a reference point.

Discharge Phase:

  • Voltage is continuously monitored.
  • Coulomb counting tracks the charge removed.
  • Impedance is checked periodically to refine the SOC estimate.
  • Temperature compensation adjusts the readings. 

State of Charge Calculation:

  • Combining the voltage, coulomb count, and impedance data, the BMS computes the SOC.
  • This value is then translated into a percentage to display the remaining battery life. 

Finally - A Couple Formulas


There are two formulas commonly used - the first uses current (Coulomb Counting) and the second voltage (Voltage-Based SOC Estimation)

 

Formula for Coulomb Counting Estimation:



Formula for Voltage-Based SOC Estimation:



Battery percentage calculations rely on sensor measurements that account for the various factors affecting battery performance. Using real time sensor data, BMS algorithms continue to advance, providing estimates of remaining battery charge.