HKU Law and Technology Centre launches HKU AI Lawyer: Sentencing Predictor for Drug Trafficking

Recent advances in artificial intelligence (AI) and machine learning have great potentials to bring revolutionary changes to legal practice. AI can be used to draw insights from past judicial decisions to predict future outcomes. In the criminal justice system, one essential aspect is sentencing. Much attention has been placed on how AI informs decisions about sentencing and how to use AI to assist people to obtain and make use of sentencing information.

The HKU’s research team led by Professor Ben Kao of the Department of Computer Science and Professor Anne Cheung of the Faculty of Law has developed a Stage-1 model of HKU AI Lawyer – an AI-assisted sentencing predictor for the offence of trafficking in dangerous drugs in Hong Kong.

The sentencing predictor is capable of handling 8 types of commonly used dangerous drugs. Users only need to provide relevant information through responding to four simple questions, and the predictor will generate an estimated term of imprisonment with an explanation of the effect of individual selected features on the overall predicted sentence. Another useful feature of the predictor is that it will at the same time show the links to court decisions which are relevant to the given facts.

A workshop was held on May 18, 2021, to introduce the HKU AI Lawyer and demonstrate its use. Mr Wilson Chan, Deputy Director of the Hong Kong Federation of Youth Groups, also shared how his organization benefits from the sentencing predictor.

The sentencing predictor is a pragmatic tool for professionals including lawyers, social workers and teachers to access relevant sentencing information of drug trafficking much quicker, thereby reducing their research time and cost. It also serves to inform the public of the likely legal consequences of committing drug trafficking offences.

The predictor is based on an innovative combination of legal domain knowledge and AI technologies. To make sentence predictions, the machine is trained to master two kinds of knowledge. The first kind includes the legal principles, sentencing guidelines, logical steps, and the salient factors that judges generally follow in determining sentence. For example, based on the types and weights of the drugs involved in case, a judge would first determine a starting point of the sentence. The sentence is then adjusted based on relevant aggravating and mitigating factors. The machine was taught the domain knowledge by legal experts. The second kind of knowledge is statistical rules derived from historical judgments. Computer science experts use machine learning and natural language processing techniques to train the machine so that it possesses the intelligence to read and comprehend previous court judgments. With references to more than 3,000 court judgments, the machine remembers and understands the relevant sentencing logic of the historical cases. This allows the machine to derive statistical rules on the quantitative elements when given a new case for which prediction is to be made, for example, given an aggravating factor, such as cross-border trafficking, the number of months of additional imprisonment that would likely be imposed.

In the next phase, subject to the availability of resources, the research team will apply AI technologies in other legal domains, including developing a personal injuries compensation predictor.

The sentencing predictor is available at

HKU AI Lawyer: Sentencing Predictor for Drug Trafficking desktop version


HKU AI Lawyer: Sentencing Predictor for Drug Trafficking mobile version


(From left) Professor Anne Cheung, HKU Faculty of Law, Professor Ben Kao, HKU Department of Computer Science and Mr Michael Cheung, HKU Faculty of Law presented the HKU AI Lawyer: Sentencing Predictor for Drug Trafficking.

(左起) 港大法律學院張善喻教授、港大計算機科學系高志明教授及港大法律學院張文傑先生介紹及示範「港大人工智能律師:販毒罪量刑估算程式」

About HKU Law and Technology Centre

The Law and Technology Centre was established in 2001 by the Faculty of Law and the Department of Computer Science at the University of Hong Kong. The Centre provides public services in the interdisciplinary area of information technology and law and advances research into the relationship between information technology and law. Through knowledge exchange and public engagement, it aims to translate its research output and legal knowledge into actions that exert positive impacts on industry, government and the public. For more information about the Centre, please visit

Media enquiries:
Ms Grace Chan, HKU Faculty of Law (Tel: 3917 4727; Email: )

















陳文芊小姐 (電話:3917 4727; 電郵:)

Back to News