AI Sentencing: The Way Forward?

This is a submission for Jie’s Sheng blog (‘Against the Tides’). This article is the sole opinion of Nathan Hew and does not represent the views of Brainylaw on this matter.

AI Sentencing: The Way Forward?

On the 20th of February 2020, the Sabah Magistrate Courts began to use artificial intelligence (AI) to assist Judges in deciding the appropriate sentences for certain criminal offences. [1] Currently, this AI is being deployed for two types of offenses in the Sabah and Sarawak courts, namely Section 12(2) of the Dangerous Drugs Act 1952 for drug possession [2] and Section 376 of the Penal Code for rape [3].

This is no doubt a revolutionary move that is taken by the Malaysian Judiciary. The use of AI in the criminal sentencing process is a controversial and touchy subject – thereby explaining the lack of such use in most jurisdictions. Before we analyze the legality and consequence of AI Sentencing, it is best to identify the basic mechanism on how the criminal sentencing process works in Malaysia.

Criminal Sentencing Process: Malaysia 

Criminal Trial Procedure

The Criminal Procedure Code (CPC) provides a guide for the Court to follow in sentencing an accused. In Malaysia, most criminal cases will begin in the Magistrate, Sessions and High Court. This depends on the severity of each offense and the trial and sentencing jurisdiction of each Court. The CPC is the main reference point for the trial procedures in these Courts.

The sentencing process may arise in 2 situations if a criminal case proceeds to trial. Following Section 173(b), 178 and 183 CPC [4], an accused can be sentenced according to law if he pleads guilty. The plea must be unconditional and voluntary. [5] Once his plea is recorded, he is convicted for the offence he is charged with.

Alternatively, the Court may find the accused guilty of the offence he is charged with after the conclusion of a trial. [6] Usually, the Prosecution would have proven its case beyond a reasonable doubt and the Defence has failed to defend the accused on a balance of probabilities. Here, the accused will be convicted for the offence he is charged with and sentenced according to law. [7]


Sentencing is the final stage of the criminal process. The Courts will consider a number of principles ingrained in common law such as deterrence, rehabilitation, prevention and retribution while sentencing the accused. [8]

Aside from this, the phrase ‘sentence according to law’ is used in the CPC. The legal meaning of this is explained in PP v Jafa b Daud [9]. The Court’s power to sentence is limited according to the scope of the punishing section and judicial principles.

The simple way to illustrate the scope of the punishing section is to give an example. In our case, Section 376 of the Penal Code provides for a variety of sentences for the crime of rape. If an accused is charged for rape under Section 376(2), he shall be punished with imprisonment for at least ten years and a maximum of thirty years and shall also be liable to whipping. [10]

The term ‘shall be punished’ means that the Court has no discretion to choose the severity of the sentence unless the section affords the Judge to do so. Following our example, a Judge must sentence an accused to jail. However, the Judge has the discretion to choose the length of the jail term and whether to impose a whipping sentence.

Section 12 of the Dangerous Drugs Act 1952 provides that an accused shall be liable on conviction to a fine not exceeding one hundred thousand ringgit or to imprisonment for a term not exceeding five years or to both. [11] Here, the Judge has the discretion to impose a fine, send the accused to a 5-year jail term or both.

Judicial principles referring to the sentencing policy of a particular offense which can be found in case law. Following the principle of stare decisis, the Judge should not be too off the mark from a previous sentencing precedent in a particular case. These cases will also help shed light on the types of mitigating and aggravating factors a Judge considered for an offense.

CPC also provides for additional mechanisms to help the Court to identify an appropriate sentence for a crime. Particulars of an accused’s previous convictions, character and mitigating plea would be recorded by the Court. [12] In the High Court, the Court may request for a victim impact statement if it feels the need to do so. [13].

AI Sentencing in Sabah 

Chief Judge of Sabah and Sarawak, Tan Sri David Wong. Image by Malay Mail.

Chief Judge of Sabah and Sarawak Tan Sri David Wong noted that Malaysia would be the first in Asia to adopt AI in the sentencing process. To his knowledge, he notes that there is no other judiciary using AI except in the United States. [14]

The AI will analyze a set of data for the offences named above. The data are gathered from cases registered in Sabah and Sarawak in a five year period from 2014 to 2019. Justice Tan has also revealed that the AI will only act as a guide to the Judge in coming to his or her decision. [15]

The aim of this project is to ensure consistency in sentencing as there have been complaints about the disparity in sentences over the years. [16] This issue arose again when a single mother was sentenced to 30 days in jail for violating the Movement Control Order. In two other cases where the accused was charged and sentenced by the same Court, they were fined RM 1,000. [17]

Lee Shih, a corporate lawyer also provides some insights into the workings of the AI mechanism. [18] To summarize, the AI would help the Prosecution and Defence to make better submissions on how the Court should sentence the accused. The accused would also make an informed decision if he decides to plead guilty as the sentence suggested by the AI would be disclosed to the accused.

Arguments Against AI Sentencing

While having an AI to give an independent opinion will help in ensuring certainty in the sentencing process, the Malaysian Judiciary is still treading into unknown waters. Justice Tan notes that he is aware of this when he launched the program but he will let the objections take its course. If there are valid grounds to object, the counsel can appeal against the sentence. [19]

One of the counsels, Hamid Ismail who represented an accused in these cases raised a constitutional argument. He submitted that the use of AI in sentencing an accused breach his constitutional right under Article 5(1) and 8(1) of the Federal Constitution.

Article 5(1) provides that the deprivation of life must be in accordance with the law and Article 8(1) provides that all are equal before the law. [20] He argues that if the Court were to impose a sentence based on an AI machine it would not be according to law. [21]

Furthermore, Hamid cited the case of Mohamed Abdullah Ang Swee Kang v Public Prosecutor [22] which reaffirms the principle in PP v Jafa b Daud. The Court’s sentencing power should only be limited by the scope of the punishing section, judicial principles and sentencing policy of a crime. He also argues that although the AI acts as a guide, he is afraid that it might influence the judge’s decision. [23]

Hamid’s concern on the kind of data that is imputed to the AI is valid. Since the AI would be working on a data set from 2014-2019, there is nothing to prevent the machine from suggesting a heavy sentence if the previous case contains a higher number of cases where the Judge has imposed a harsher sentence.

This phenomenon is known as the ‘junk in junk out syndrome’ in which it refers to the input of incomplete or ‘dirty’ data which will result in an unreliable output. [24] Although AI Sentencing has limited application in Malaysia, the Malaysian Judiciary must consider this as a future hurdle to overcome in its adoption of AI when determining the types of sentences in criminal trials.

Comparative Jurisdiction: America

The Public Safety Assessment is one of many AIs that are integrated into the American criminal justice system. Image by Justice Management Institute.

Not many countries have adopted the use of Artificial Intelligence when deciding Sentencing. Pursuant to Article 22(1) of the European Union General Data Protection Regulation, residents in the Union have the right not to be subject to a decision based solely on automated processing. [25]

One jurisdiction that has welcomed AI into the criminal justice system is the United States of America. Professor Salleh Buang, a former federal counsel at the Attorney General Chambers has written on a few examples of its use [26]:

  1. In New Jersey, a risk assessment algorithm called the Public Safety Assessment is used in determining whether a Judge should grant bail to a Defendant. If the Defendant meets the criteria, bail is granted. [27]

  2. In California, authorities have embraced AI in an effort to solve the problems of overcrowded prisons.

  3. In Los Angeles, its courts have used AI to handle traffic cases. Gina, an AI-powered avatar will interact with the public to pay a traffic ticket, register for traffic school, or schedule a court date. Installed in 2016, Gina has completed more than 200,000 transactions annually.

Although AI can be useful to reduce inefficiencies in the system, it is costly for the Judiciary to maintain the system. For instance, Judge Glenn Grant (who is the acting administrative director of the PSA program) revealed that the Judiciary will run out of money to sustain the program by the end of 2020. It is currently funded by court filing fees. [28]

Another problem relates to the ‘junk in junk out’ syndrome. Given that the decisions behind the data are not necessarily neutral and that the programs are socially constructed, there are instances where the AI has been racially biased against a certain race. [29] For instance, the trial Judge in Wisconsin gave the Defendant a long prison sentence partially because he was wrongly labeled “high risk” by the risk assessment algorithm.


I believe that humans are inherently good. As such, human emotions and conscience form the essence of a criminal justice system. Dr Cheryl Lawther, Senior Lecturer of the School of Law at Queen’s University Belfast affirms that crime is a social construct. As such, nothing beats the human element in a criminal justice system.

There is a fine line between balancing an individual constitutional right and the implementation of AI to help reduce the inefficiency in the criminal justice system. Although the Malaysian Judiciary has taken a bold move in Sabah and Sarawak to move forward with AI, the system needs to be tested to see its potential and limits. Until then, if we do not try we cannot move forward. [30]


[1] O Miwil, ‘Sabah court to make history on Wednesday by using AI in sentencing’ accessed 7th June 2020.

[2] Dangerous Drugs Act 1952, S12(2).

[3] Penal Code, S376.

[4] Criminal Procedure Code, S173(b), S178, 183.

[5] Criminal Procedure Code, S173(b) and 178(2).

[6] Criminal Procedure Code, S173(m)(ii) and S182A(2).

[7] Criminal Procedure Code, Section 173(m)(ii) and S183.

[8] Dr Gan Chee Keong, ‘Conceptualizing the Principles of Sentencing in Criminal Offences in Malaysia: Bridging Theory and Reality’ European Academic Research, Vol V Issue 5, August 2017.

[9] PP v Jafa b Daud [1981] 1 MLJ 315

[10] Penal Code, Section 376(2).

[11] Dangerous Drugs Act 1952, Section 12(2).

[12] Criminal Procedure Code, Section 176(2)(r).

[13] Criminal Procedure Code, Section 183.

[14] O Miwil, ‘Sabah court to make history on Wednesday by using AI in sentencing’ accessed 7th June 2020.

[15] Ibid.

[16] K Inus, ‘Sabah begins AI for data sentencing’ accessed 7th June 2020.

[17] N Hamdan, ‘Single mum gets 30-day sentence for MCO violation commuted to RM1,000 fine’ accessed 7th June 2020.

[18] L Shih, ‘Artificial Intelligence has Arrived for Criminal Sentencing’ accessed 7th June 2020.

[19] K Inus, ‘Sabah begins AI for data sentencing’ accessed 7th June 2020.

[20] Federal Constitution, Article 5(1) and 8(1).

[21] Borneo Post Online, ‘ Use of AI in sentencing breaches constitution? Lawyers entitled to opinion – CJ’ accessed 7th June 2020.

[22] Mohamed Abdullah Ang Swee Kang v Public Prosecutor [1987] 2 CLJ 405.

[23] K Inus, ‘Sabah begins AI for data sentencing’ accessed 7th June 2020.

[24] Optum, ‘Big data challenge: Junk in means junk out’ accessed 7th June 2020.

[25] European Union General Data Protection Regulation, Article 22(1).

[26] S Buang, ‘Don’t allow AI use in sentencing’ accessed 7th June 2020.

[27] E Livni, ‘ In the US, some criminal court judges now use algorithms to guide decisions on bail’ accessed 7th June 2020.

[28] C Aquart, ‘ New Jersey Used An Algorithm To Revamp Its Bail System: Is It Working, And At What Cost?’ accessed 7th June 2020.

[29] S Buang, ‘Don’t allow AI use in sentencing’ accessed 7th June 2020.

[30] Borneo Post Online, ‘ Use of AI in sentencing breaches constitution? Lawyers entitled to opinion – CJ’ accessed 7th June 2020.

52 views0 comments

Recent Posts

See All