# Aligning Large Language Models with Counterfactual DPO

Bradley Butcher Independent Researcher<EMAIL_ADDRESS>
###### Abstract

Advancements in large language models (LLMs) have demonstrated remarkable
capabilities across a diverse range of applications. These models excel in
generating text completions that are contextually coherent and cover an
extensive array of subjects. However, the vast datasets required for their
training make aligning response styles during the pretraining and instruction
tuning phases challenging. Consequently, an additional alignment phase is
typically employed, wherein the model is further trained with human preference
data to better align its outputs with human expectations. While this process
doesn’t introduce new capabilities per se, it does accentuate generation
styles innate to the model. This paper explores the utilization of
counterfactual prompting within the framework of Direct Preference
Optimization (DPO) to align the model’s style without relying on human
intervention. We demonstrate that this method effectively instils desirable
behaviour, mitigates undesirable ones, and encourages the model to disregard
inappropriate instructions. Our findings suggest that counterfactual prompting
with DPO presents a low-resource way to fine-tune LLMs to meet the demands for
responsible and ethically aligned AI systems.

##  1 Introduction

Recent progress in LLMs has elevated their text generation capabilities to a
commercially viable standard Qin et al. (2023); Vilar et al. (2022); Chowdhery
et al. (2022). These models are increasingly employed across diverse sectors,
including chatbots, customer support assistants, retrieval-augmented
generation (RAG), and structured data extraction Soni (2023); Lu et al.
(2021); Gao et al. (2023). As their integration becomes more widespread in
professional and personal settings, aligning these models with user
preferences has become crucial.

The training of LLMs typically involves three stages Ziegler et al. (2019).
Initially, in the general pretraining stage, the model learns the structure of
the language, gains context understanding, and develops the ability to
generate coherent and relevant text Radford et al. (2018). This is achieved by
training the LLM to predict the next word in a sequence from a large corpus,
including books, websites, and other texts, an approach known as causal
language modelling (CLM) Vaswani et al. (2017).

Following this, the model undergoes instruction fine-tuning, employing the
same CLM objective but with data structured as pairs of instructions and
responses. This phase enables the model to learn specific response patterns to
various instructions, building on the foundational knowledge from the
pretraining phase.

The final stage, alignment with human preferences, aims to refine the model’s
output for specific contexts, such as reducing hate speech or offering more
concise responses Ziegler et al. (2019). This typically involves human
annotation, where users select their preferred response from multiple options
generated by the LLM. However, this process is inherently limited, as the
model must already be capable of generating both styles of response; the
process merely emphasizes one style over the other. Furthermore, this approach
is constrained by the need for extensive human annotations and the untargeted
nature of preference selection.

Addressing these limitations, this paper introduces a novel approach using
counterfactual prompts in the alignment stage, eliminating the need for human
intervention. Our method utilizes counterfactual styles within the Direct
Preference Optimization (DPO) framework to guide the model’s output Rafailov
et al. (2023). This approach simplifies the alignment process and enhances
scalability by directly injecting desired stylistic preferences into the
model, a significant departure from traditional Reinforcement Learning from
Human Feedback (RLHF) methods that depend on the availability and selection of
styles by human evaluators. Our experiments are aimed at evaluating how
effectively this method encourages the use of desired latent styles, minimizes
the use of unwanted styles, and ignores inappropriate instructions. The
results demonstrate that through counterfactual prompts combined with DPO, our
approach can effectively reduce hallucinations, decrease bias, and ignore
adversarial instructions. Our method offers a more controlled and efficient
way to shape LLM responses, whilst maintaining the performance of the original
model.

With new global policies and rules for LLMs coming into play, it’s important
to make sure these models meet set behavior standards before they’re released
European Parliament (2023). In today’s world, where open-source models are
common, simply using prompts to guide behavior is not enough. Our method
provides a way to deal with this issue. It allows for the embedding of certain
behaviors in models before they are made available, offering researchers a
practical tool to ensure models act as intended from the start.

Figure 1: An illustration of DPO and Counterfactual DPO (ENC). On the left,
DPO is as normal, where human preference information is used to fine-tune the
LLM policy via maximum likelihood. On the right, counterfactual DPO is used,
desired style information is used to generate treatment and control prompts
and responses. The treatment is assumed to be the preferred generation. DPO
proceeds as normal, assuming the control prompt was used to generate both
responses. We include diagrams of the other method configurations in
supplementary material.

##  2 Background

In the RLHF paradigm, LLMs are seen as policy models, with token selection as
actions. This policy is optimized to maximize its token selection per human
preference Ziegler et al. (2019). It is generally applied following an
instruction tuning phase, where a pre-trained language model is fine-tuned on
curated data for tasks such as summarization, instruction following, or
dialogue, resulting in a model $\pi_{sft}$. It is generally formulated as
three steps:

  * •

Data Collection: The first step is to collect human preference data. Pairs of
responses $(y_{1},y_{2})$ generated by $\pi_{sft}$ given a prompt $x$ are
evaluated by human labelers to produce winning and losing responses
$(x;y_{w},y_{l})$.

  * •

Reward Modelling Phase: The collected preference data is used to model a
reward function, commonly the Bradley-Terry model Bradley and Terry (1952);
Ziegler et al. (2019), leading to a parameterized reward model $r_{\phi}(x,y)$
optimized via maximum likelihood:

$\mathcal{L}_{R}(r_{\phi},\mathcal{D})=-\mathbb{E}_{(x,y_{w},y_{l})\sim\mathcal{D}}[\log\sigma(r_{\phi}(x,y_{w})-r_{\phi}(x,y_{l}))]\vspace{3mm}$

where $y_{w}$ and $y_{l}$ are the preferred response and rejected response,
respectively.

  * •

Reinforcement Learning Phase: The learned reward function guides the language
model’s training in an actor-critic fashion Sutton and Barto (2018). This is
typically PPO, a trust region method that optimizes the policy $\pi_{\theta}$
to maximize $r_{\phi}(x,y)$ while keeping the policy close to the initial SFT
model $\pi_{sft}$.

$\text{Let
}\mathbb{E}\left(r_{\phi}\right)=\mathbb{E}_{x\sim\mathcal{D},y\sim\pi_{\theta}(y\mid
x)}[r_{\phi}(x,y)],$ $\text{ and
}\mathbb{D}_{\textrm{KL}}=\mathbb{D}_{\textrm{KL}}[\pi_{\theta}(y\mid
x)||\pi_{sft}(y\mid x)].$

The objective is then:

$\displaystyle\max_{\pi_{\theta}}\Biggl{[}$
$\displaystyle\mathbb{E}\left(r_{\phi}\right)-\beta\mathbb{D}_{\textrm{KL}}\Biggr{]}$

REINFORCE and other methods are also commonly used Williams (1992); Ramamurthy
et al. (2022).

Despite the effectiveness of RLHF, challenges such as training instability,
harsh memory requirements, and the need to train a competent reward model
persist Li et al. (2022).

Direct Preference Optimization (DPO): DPO attempts to address these challenges
by removing the need for an explicit reward model or reinforcement learning
process Rafailov et al. (2023). The LLM acts as it’s own reward model and is
directly optimized via maximum likelihood:

$\text{Let
}M(x,y_{w},y_{l})=\beta\log\frac{\pi_{\theta}(y_{w}|x)}{\pi_{sft}(y_{w}|x)}-\beta\log\frac{\pi_{\theta}(y_{l}|x)}{\pi_{sft}(y_{l}|x)}.$
$\displaystyle
L_{DPO}(\pi_{\theta};\pi_{sft})=-\mathbb{E}_{(x,y_{w},y_{l})\sim
D}\Bigl{[}\log\sigma\left(M(x,y_{w},y_{l})\right)\Bigr{]}.$

The authors show that this method is at least as performant as PPO-based RLHF,
and effectively reduces the complexity of aligning LLMs with preference data.

##  3 Related Work

With the increasing usage of Large Language Models (LLMs) in real-world
applications, the emphasis on directing these models towards desirable
behaviors has become crucial. Several studies have concentrated on alignment
methodologies that minimize human intervention. Lee et al. (2023) introduce
Reinforcement Learning from AI Feedback (RLAIF), positioned as a viable
alternative to RLHF. This approach utilizes an existing LLM to generate
preference labels for the training of another LLM, effectively diminishing the
dependence on human feedback and yielding results on par with, or superior to,
traditional methods in areas like summarization and dialogue generation.

Bai et al. (2022) present ’Constitutional AI’, a method designed to train a
benign AI assistant through self-improvement, significantly reducing the need
for human-generated labels. This method is structured in two phases: an
initial supervised learning phase for model self-critique and revision based
on a set of principles, and a subsequent reinforcement learning phase to
develop and utilize a preference model for further training. This approach
offers the advantage of more precise control over AI behaviors with a reduced
need for human labels. Nonetheless, it faces challenges such as the occasional
inaccuracies in the model-generated critiques.

In a study by Xu et al. (2023), Contrastive Post-Training (CPT) is utilized
for aligning Large Language Models (LLMs) with human preferences by generating
response pairs from LLMs of varying capabilities. This method notably enhances
model alignment and effectiveness, particularly when integrated with Direct
Preference Optimization (DPO). The synergy between CPT and our work suggests a
potential for combined complementary application.

##  4 Method

In the standard Direct Policy Optimisation (DPO) framework, a human evaluator
typically ranks the outputs from a reference policy, labeling winning and
losing pairs $y_{w}=\pi_{sft}(x)$ and $y_{l}=\pi_{sft}(x)$. However, when the
reference model $\pi_{sft}(x)$ reliably follows instructions, it becomes
possible to bypass the need for human annotation by adding styling to the
prompts.

Let’s first define terms:

  * •

Control Prompt ($x_{c}$): The basic prompt without added style. Example: “Tell
me about the capital of France.”

  * •

Treatment/Positive Prompt ($x_{t}$ . $x_{+}$): The reference prompt with added
desired style. Example: “Tell me about the capital of France - be concise.”

  * •

Negative Prompt ($x_{-}$): The reference prompt with added undesired style.
Example: “Tell me about the capital of France - be verbose and rude.”

  * •

Control Response ($y_{c}=\pi_{sft}(x_{c})$): The LLM’s response to the control
prompt $x_{+}$.

  * •

Treatment Response ($y_{t}=\pi_{sft}(x_{t})$): The LLM’s response to the
treatment prompt $x_{+}$.

  * •

Negative Response ($y_{-}=\pi_{sft}(x_{-})$): The LLM’s response to the
negative prompt $x_{-}$.

We can use DPO with the treatment and control responses. Human annotation is
not needed as we’re directly generating desired styling, and therefore assume
the treatment style is preferred. We effectively fool DPO into optimising
assuming the treatment generation was created with the reference prompt $x$,
nudging the default style of an LLM towards the desired style111Note that a
range of instruction prompts must be used to change the style for all types of
instructions - focusing on just summarization will likely just change the
style for summarisation. We generously consider this a feature.. This method
steers the language model to produce outputs more in line with the treatment
style and less in line with the control style. This approach has several
configurations, dependent on the desired result: Counterfactual DPO,
Contrastive DPO, and Instruction Negation.

$\displaystyle
L_{DPO}(\pi_{\theta};\pi_{sft})=-\mathbb{E}_{(x,y_{t},y_{c})\sim
D}\Bigl{[}\log\sigma\left(M(x,y_{t},y_{c})\right)\Bigr{]}.$ (1)

Counterfactual DPO \- This can be considered a ’one-sided’ styling. In the
general case, the treatment response is designated the preferred response. The
control response is simply the response formed without any styling. For
example, augmenting a prompt with a treatment style with positive
instructions, such as ”be kind” or ”restrict to given context”, encourages the
likelihood of the model generating outputs aligned with these directives. We
refer to this as $\text{Counterfactual}_{\text{ENC}}$ DPO, corresponding to
equation 1.

It is a noted challenge that LLMs often struggle with following vague or broad
instructions, such as ”avoid hallucinations” or ”stick to factual information”
Liao et al. (2023). These models, by their nature, generate plausible but not
necessarily factually accurate sequences. Therefore, adding instructions like
”avoid hallucinations” to a prompt may not yield the desired outcome. However,
prompting to promote hallucination or creative freedom can be more
straightforward. Simply: in some scenarios, it is easier to generate negative
examples than positive ones. In this approach, the treatment is considered
rejected, and the unstyled prompt is considered preferred. By maximizing the
log margin between these two types of prompts, the model should discourage the
likelihood of generating treatment-styled output. We refer to this as
$\text{Counterfactual}_{\text{DIS}}$ DPO.

$\displaystyle
L_{DPO}(\pi_{\theta};\pi_{sft})=-\mathbb{E}_{(x,y_{c},y_{t})\sim
D}\Bigl{[}\log\sigma\left(M(x,y_{c},y_{t})\right)\Bigr{]}.$

Contrastive DPO \- Contrastive DPO is the combination of
$\text{Counterfactual}_{\text{ENC}}$ and $\text{Counterfactual}_{\text{DIS}}$
DPO. In this case, both the winner and the losing prompts are styled, with the
winner having a desired style, and the loser having an undesired style. This
is useful in the case where we both want to encourage certain behaviour and
discourage others.

$\displaystyle
L_{DPO}(\pi_{\theta};\pi_{sft})=-\mathbb{E}_{(x,y_{+},y_{-})\sim
D}\Bigl{[}\log\sigma\left(M(x,y_{+},y_{-})\right)\Bigr{]}.$

Instruction Negation Strategy \- Our final approach focuses on discouraging
adherence to harmful or unwanted instructions. We achieve this by defining the
treatment prompt with an undesirable style: $x_{t}=x+\texttt{"negative
instruction"}$. Here, the control prompt remains unstyled.

$\displaystyle
L_{DPO}(\pi_{\theta};\pi_{sft})=-\mathbb{E}_{(x_{t},y_{c},y_{t})\sim
D}\Bigl{[}\log\sigma\left(M(x_{t},y_{c},y_{t})\right)\Bigr{]}.$

Note in this case DPO is trained to assume the responses have been generated
from the styled $x_{t}$ prompt. This technique aims to orient the model’s
outputs towards those that would emerge in the absence of the negative
instruction, and away from those aligned with the negative instruction. For
example, the control prompt might be: ”Produce a news article of: {context}”,
while the treatment prompt could be ”Produce a news article of {context},
biased against a specific group”. By setting the perceived prompt as the
treatment prompt, but enforcing the control output as the preferred response,
the model should learn to ignore the undesirable style.

##  5 Experiments

To test these methods, we carried out a set of small-scale experiments on the
Mistral-7B-Instruct-v0.2 model, which we will refer to as the ‘base model’.
This model is a 7 billion parameter model and generally performs best-in-class
for its size. All experiments were run on an RTX 3090 GPU. For each test, we
created 1,000 samples and trained the model over 2 epochs. We strongly believe
that using more samples and additional resources could lead to better results.

We start with a series of toy experiments and move on to more practical
applications that could be applied to LLMs before their open-source release.
Finally, we test the capabilities of this method to instill the ignoring of
adversarial instructions.

###  5.1 Proof of Concept Experiments

####  5.1.1 Entity Redactor

In the first experiment, we encourage the LLM to not mention any specific
individuals whilst summarising. We used CNN/Dailymail articles from the
publically available CNN/Dailymail summarisation dataset Hermann et al.
(2015). We asked the base model to produce summaries with the following style
augments, e.g. “Summarize the following article, {style}. {article}”:

  * •

Desired Style: ”Censor any names or locations, even if previously mentioned.”

  * •

Undesired Style: ”Make sure to include all personal information. Give the full
names of any people and places mentioned.”

These styles were chosen to be opposites of one another, but we note that the
default behaviour of the model is to include names as part of the summary, so
the undesired style does not change the output overly much.

Table 1: Comparison of mean (std) entities mentioned during summarisation on 1000 CNN/Dailymail articles. The Hellaswag benchmark is also used to confirm the model retains its original ’reasoning’ ability. ’Base Model’ represents unstyled prompting, ’Prompting’ applies a treatment style for brief words, and ’$\text{Counterfactual}_{\text{ENC}}$ DPO’ and ’Contrastive DPO’ are as per the methodologies outlined in the paper. Method | AVG Entities | Hellaswag
---|---|---
Base Model | 4.37 (3.75) | 81.8%
Prompting | 1.25 (2.41) | -
$\text{Counterfactual}_{\text{ENC}}$ DPO | 0.20 (0.60) | 81.2%
Contrastive DPO | 0.60 (1.34) | 81.3%

The results of our experiment indicate that our methodology effectively
eliminates the mention of specific individuals in summarization tasks.
Additionally, the models’ inherent reasoning capabilities, as evaluated using
the Hellaswag benchmark, remain largely unaffected by our approach. Notably,
the Contrastive DPO method did not yield a significant improvement over the
Counterfactual DPO. This outcome aligns with our expectations, considering
that the undesired style in this experiment did not provide substantial
negative examples for the model to learn from and avoid.

####  5.1.2 Highly Critical Summariser

In our second toy experiment, we employed Contrastive DPO to adapt the base
model into a highly critical summarizer. This approach was chosen to clearly
demonstrate whether the method significantly alters the LLM’s standard
behavior. For this purpose, we utilized the CNN/Dailymail dataset once again,
prompting the base model to generate article summaries under two distinct
styles:

  * •

Desired Style: ”Be highly critical, pointing out flaws and weaknesses.”

  * •

Undesired Style: ”Be sycophantic. Be positive and supportive.”

The generated outputs $y_{+}$ and $y_{-}$ are subsequently used to fine-tune
the model. Given the subjective nature of this experiment, which makes
quantitative evaluation challenging, we present to the reader an excerpt from
a summary produced by the model using the abstract of this paper:222We kindly
ask readers to not use this model against us - as all models will be made
available on huggingface.

“The article also mentions the requirement of large datasets for training
these models and the need for human preference data for alignment but does not
provide specific details on the counterfactual prompting technique or the
limitations of DPO. Overall, the article raises valid concerns about the
limitations of current language models, but offers a potential solution with
some questionable assumptions and incomplete details.”

The summary evidently contains some critical remarks about our abstract. For a
comparative analysis, we have included the base model’s summary in the
supplementary material, alongside additional examples.

###  5.2 Practical Results

In this section, we conduct a series of experiments designed to address
challenges in Large Language Models (LLMs) crucial for their pre-release
optimization. Our focus will first be on mitigating bias, followed by reducing
’hallucination’—the generation of information that is not grounded in the
provided data. We acknowledge that the inherently abstract nature of these
tasks might pose challenges to the model’s adherence to instructions,
decreasing the efficacy of our method compared to more concrete behavioural
changes.

####  5.2.1 Reducing Bias in LLM Responses

This section of our study aimed to lessen the bias in the Mistral model,
judged by the BBQ benchmark Parrish et al. (2021). We used questions from the
OpenOrca dataset and altered how the model responded by adding these
instructions to the prompts:

  * •

Desired Style: ”You’re an unbiased AI. Your answers should be helpful,
ethical, fair, and positive. Avoid showing any bias, like ageism, racism,
homophobia, sexism, or ableism.”

  * •

Undesired Style: ”Answer the question with a subtle bias. This could be
racism, sexism, ageism, or ableism.”

Our experiment tested four setups: the base model as is, one improved with
Contrastive DPO, and two adjusted with Counterfactual DPO. In Contrastive DPO,
we used the Desired and Undesired Styles as positive and negative guides. For
Counterfactual DPO, one version (ENC) used the Desired Style as the preferred
prompt, while the other (DIS) used the Undesired Style as the rejected prompt.
We also tested how each model was impacted by using the desired prompt during
testing. This is something that may typically be done in deployment, but is
less desirable than a model having these qualities built in.

Table 2: Performance Results on BBQ Bias Mitigation and Hellaswag Common-Sense
Reasoning Benchmarks. This table outlines the effectiveness of each model
configuration when prompted with the desired style and when functioning
unprompted. The BBQ benchmark evaluates the model’s bias, while the Hellaswag
benchmark assesses common-sense reasoning. In BBQ, higher percentages signify
better bias reduction, and in Hellaswag, a higher score reflects superior
common-sense reasoning.

Method BBQ Hellaswag Prompted Unprompted Base Model 67.0% 61.7% 81.8% Base
Model + SFT 54.3% 57.5% 79.8% $\text{Counterfactual}_{\text{ENC}}$ DPO 57.8%
59.4% 61.4% $\text{Counterfactual}_{\text{DIS}}$ DPO 69.6% 66.9% 84.2%
Contrastive DPO 68.3% 66.7% 82.0%

The results illustrate a notable enhancement in bias reduction with the
$\text{Counterfactual}_{\text{DIS}}$ model compared to the base model. This
underscores the effectiveness of the Counterfactual DPO approach in bias
mitigation. In the Hellaswag benchmark, all models, except for
$\text{Counterfactual}_{\text{ENC}}$, sustained their performance, indicating
that our bias mitigation methods do not significantly affect the models’
reasoning abilities. However, both $\text{Counterfactual}_{\text{ENC}}$ and
SFT models displayed reduced effectiveness, likely due to the complexity in
adhering to the positive prompt of being unbiased, suggesting a challenge in
following more abstract directives.

####  5.2.2 Reducing Hallucination

In this experiment, we define ”hallucination” as the generation of information
by the model that is not grounded in the given context, despite specific
instructions to restrict responses to the provided content. This aspect is
crucial for applications like Retrieval Augmented Generation and Document-
based Question Answering, where grounding is paramount. To measure our model’s
ability to reduce hallucinations, we employed the Vectara hallucination
evaluation model and benchmark Hughes and Bae (2023). For training, we used
the same question set from the OpenOrca dataset that was utilized in our bias
reduction experiment. The model was fine-tuned with prompts designed to
encourage or discourage hallucination, as detailed below:

  * •

Desired Style: ”You are a truthful AI assistant. Answer concisely only using
the context.”

  * •

Undesired Style: ”When answering the question, add information that is not in
the prompt.”

We evaluate on the same set of models; the base model, the base model with
supervised fine-tuning on the (prompt, desired output) pairs, and the three
types of DPO defined in section 4.

Table 3: Table illustrating the Factual Consistency Rate (FCR) across
different model configurations. The FCR measures the ability of models to
avoid adding unprovided information in their responses, a key factor in
hallucination reduction. The evaluation was conducted using the Vectara
hallucination model and benchmark, with the OpenOrca dataset providing the
questions. The table compares the base model, the base model with supervised
fine-tuning (SFT), and three types of Direct Preference Optimization (DPO)
models, both with and without specific prompting styles for reducing
hallucination. The Hellaswag column shows the performance in common-sense
reasoning.

Method FCR Hellaswag Prompted Unprompted Base Model 93.2% 92.4% 81.8% Base
Model + SFT 93.2% 92.1% 80.0% $\text{Counterfactual}_{\text{ENC}}$ DPO 93.6%
94.4% 81.7% $\text{Counterfactual}_{\text{DIS}}$ DPO 94.3% 93.3% 81.4%
Contrastive DPO 94.3% 96.0% 81.8%

The outcome of this experiment highlights that the Contrastive DPO model gains
significant performance over the base model – beating Google Gemini Pro on the
Vectera hallucination leaderboard Hughes and Bae (2023). However, it still
ranks below the capabilities of GPT3.5 and GPT4. Notably, additional prompting
of the models, which were already trained to align with the desired style,
resulted in a decrease in their performance. This suggests that overemphasis
on the trained style may lead to diminished effectiveness in certain
scenarios. The underlying mechanisms behind this phenomenon remain unclear and
open up an interesting area for further investigation.

###  5.3 Ignoring Instructions

In practical deployment scenarios, the ability of LLMs to selectively
disregard specific instructions is crucial for AI safety. To evaluate the
effectiveness of our approach in enabling this capability, we conducted a
series of toy experiments. These experiments, while exploratory, provide
insight into the potential of LLMs to autonomously filter out targeted
instructions.

####  5.3.1 Pirates are banned

In our first experiment, we aim to evaluate the model’s ability to ignore
specific stylistic instructions. We chose a distinctive and easily
identifiable style – talking like a pirate – to test this capability. By
appending the control prompt $x_{c}$ with the instruction ’Speak in the style
of a pirate,’ and setting up contrasting styles, we create a scenario where
the model’s success is measured by its ability to generate responses that
deliberately avoid pirate vernacular. The styling used is as follows:

  * •

Desired Style: Null (no specific style desired)

  * •

Undesired Style: ”Speak in the style of a pirate.”

By setting the unstyled response as the ’preferred’ outcome, the pirate-styled
response as the ’undesired’ outcome, and the prompt as the pirate-styled
prompt. This setup is designed to encourage the model to avoid adopting the
pirate style in its responses. To establish a baseline, we first prompt the
base model to summarize our abstract with the instruction to “Summarize the
following article in two sentences. Speak in the style of a pirate.
{abstract}”:

“Arr, the size of our language model’s knowledge be impressive, coverin’ a
vast sea of subjects and contexts, yet alignin’ its responses to match human
style be a tricky endeavor, requirezin’ vast datasets and human intervention.
But with the use of counterfactual promptin’ in Direct Preference
Optimization, we can guide the model’s behavior without needin’ humans,
resultin’ in fewer unwanted output and more ethically aligned AI.”

The summary provided above showcases the base model’s ability to adopt a
pirate vernacular effectively. Having established that the base model can
simulate speaking like a pirate, we then applied the same prompt to the model
that was specifically trained to disregard pirate-style instructions. The
response from this trained model was as follows:

“Large language models demonstrate impressive text generation capabilities,
but aligning their responses to human expectations during training is
challenging due to the need for vast datasets. A common solution is to use
human preference data in an additional alignment phase. This paper explores
using counterfactual prompting within Direct Preference Optimization (DPO) as
a low-resource alternative to align model styles without human intervention,
effectively instilling desirable behavior and discouraging undesirable or
inappropriate responses.”

From this result, we can see we have successfully created a model that ignores
pirate-based instructions. We additionally tested changing the exact
instruction to deviate from the training style, such as “in the manner of a
pirate captain”, and this remains succesfully ignored.

####  5.3.2 Entity Redactor Revisited

In this concluding experiment, we revisited the
$\text{Counterfactual}_{\text{ENC}}$ DPO model, which we had previously
trained for the entity redaction task. Our objective was to test the model’s
flexibility in reverting to its original behavior of including names in its
responses. To this end, we modified the evaluation prompt by adding a specific
instruction: ’Include all personal information. Give the full names of any
people and places mentioned.’ Following this modification, we observed a
notable increase in the average number of entities mentioned in the model’s
responses, rising from 0.2 to 1.78.

The ability to revert was anticipated, as we had not eliminated the model’s
ability to include names; we had merely trained it to omit them by default.
However, this could be problematic in real-world use, where we might not want
users to override this default behaviour. As with our previous experiment, we
can apply counterfactual DPO to ignore instructions. This time, we add to the
control prompt $x_{c}$ the same instruction to ’Include all personal
information.’ For this test, our style parameters were set as:

  * •

Desired Style: Null (no specific style desired)

  * •

Undesired Style: ’Include all personal information. Give the full names of any
people and places mentioned.’

By teaching the model to ignore this new ‘undesired style’, the average number
of entities mentioned decreased again, from 1.78 to 0.32, when this undesired
style was included in the evaluation prompts.

##  6 Discussion

In this study, we have developed a novel alignment approach for Large Language
Models (LLMs) that minimizes reliance on human-generated data. By utilizing
counterfactual and contrastive variations of Direct Preference Optimization
(DPO), our method demonstrated effectiveness in a range of scenarios. This
innovation aligns with emerging trends in ethical AI, particularly by reducing
dependence on potentially biased human data, which can be expensive and
challenging to curate.

Our findings reveal that Contrastive DPO, combining the strengths of both
Counterfactual DPO variants (ENC and DIS), emerged as the most robust method.
From our limited results, its efficacy appears to be a weighted average,
represented as:

$\alpha\times\Delta_{\text{sft}}\text{Perf}(\text{CF}_{\text{ENC}})+\beta\times\Delta_{\text{sft}}\text{Perf}(\text{CF}_{\text{DIS}})$

where $\alpha$ and $\beta$ are coefficients representing the contributions of
the ENC and DIS variants to the overall performance of Contrastive DPO.
Notably, in our bias reduction experiment, Contrastive DPO demonstrated
resilience, maintaining robust performance even when Counterfactual DPO (ENC)
showed a decline.

The results further indicate that our approach surpasses the baseline model
performance achieved through standard prompting or supervised fine-tuning.
Importantly, it effectively eliminates undesirable behaviors and selectively
disregards specific instructions, a critical feature for deploying open-source
models where adherence to prompting guidelines is uncertain.

Looking to the future, several research directions present themselves:
conducting a sensitivity analysis to assess the method’s variability and
performance as data scales will be essential for widespread adoption.
Understanding under which conditions each method excels or falls short will be
crucial. Additionally, exploring this methodology as an iterative process and
testing the feasibility of incorporating multiple styles into a single fine-
tuned model are interesting research directions.

As global regulations for LLMs evolve, self-supervised alignment methods
become increasingly relevant. Our method enables the pre-embedding of specific
behaviours in models before their release. This ensures compliance with
regulatory and ethical standards from the outset, aligning with the imperative
for responsible AI development in a globally connected environment.

###  6.1 Frequently Asked Questions

####  6.1.1 Comparing Counterfactual and Contrastive DPO

Our experiments suggest that the choice between Counterfactual and Contrastive
DPO depends on the specific task. The success of these methods is tied to how
well the model can adopt the instructed style. If the model is too sensitive
to the specific prompts, resulting in erratic output, the training
effectiveness might be compromised. Given our results, the most stable
performer through the experiments seems to be Contrastive DPO. We offer this
general guidance: if the preferred style and rejected style can both be
followed reliably, use Contrastive DPO. If the preferred style can be followed
but not the rejected, use $\text{Counterfactual}_{\text{ENC}}$ DPO. If only
the rejected style can be followed reliably, use
$\text{Counterfactual}_{\text{ENC}}$ DPO.

####  6.1.2 The Role of Supervised Fine-tuning

For encouraging certain behaviours with $\text{Counterfactual}_{\text{ENC}}$
DPO, it might seem feasible to use supervised fine-tuning on (prompt, desired
output) pairs. However, there are two important distinctions to consider: (1)
Trust Region: DPO maintains closeness to the original model, a concept we
could feasibly achieve in SFT with partial freezing, adapters, or other
techniques. Though without an explicit penalization, this will be an
approximation (2) Moving Away from Default Outputs: DPO essentially serves as
a contrastive method, steering the model toward preferred outputs and away
from less desirable ones. In our experiments, the application of Direct
Preference Optimization (DPO) methods demonstrated superior performance
compared to traditional supervised fine-tuning approaches.

## References

  * Bai et al. [2022] Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, et al.  Constitutional ai: Harmlessness from ai feedback.  arXiv preprint arXiv:2212.08073, 2022.
  * Bradley and Terry [1952] Ralph Allan Bradley and Milton E Terry.  Rank analysis of incomplete block designs: I. the method of paired comparisons.  Biometrika, 39(3/4):324–345, 1952.
  * Chowdhery et al. [2022] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, P. Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, B. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, M. Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, S. Ghemawat, Sunipa Dev, H. Michalewski, Xavier García, Vedant Misra, Kevin Robinson, L. Fedus, Denny Zhou, Daphne Ippolito, D. Luan, Hyeontaek Lim, Barret Zoph, A. Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, T. S. Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Díaz, Orhan Firat, Michele Catasta, Jason Wei, K. Meier-Hellstern, D. Eck, J. Dean, Slav Petrov, and Noah Fiedel.  Palm: Scaling language modeling with pathways.  ArXiv, abs/2204.02311, 2022.
  * European Parliament [2023] European Parliament.  Eu ai act: first regulation on artificial intelligence, 2023.  Accessed: 2024-01-15.
  * Gao et al. [2023] Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, and Haofen Wang.  Retrieval-augmented generation for large language models: A survey.  arXiv preprint arXiv:2312.10997, 2023.
  * Hermann et al. [2015] Karl Moritz Hermann, Tomás Kociský, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom.  Teaching machines to read and comprehend.  In NIPS, pages 1693–1701, 2015.
  * Hughes and Bae [2023] Simon Hughes and Minseok Bae.  Vectara hallucination leaderboard, 11 2023.  If you use this dataset, please cite it using the metadata from this file.
  * Lee et al. [2023] Harrison Lee, Samrat Phatale, Hassan Mansoor, Kellie Lu, Thomas Mesnard, Colton Bishop, Victor Carbune, and Abhinav Rastogi.  Rlaif: Scaling reinforcement learning from human feedback with ai feedback.  arXiv preprint arXiv:2309.00267, 2023.
  * Li et al. [2022] Shuailong Li, Wei Zhang, Huiwen Zhang, Xin Zhang, and Yuquan Leng.  Proximal policy optimization with model-based methods.  J. Intell. Fuzzy Syst., 42:5399–5410, 2022.
  * Liao et al. [2023] Jiayi Liao, Xu Chen, and Lun Du.  Concept understanding in large language models: An empirical study.  2023\.
  * Lu et al. [2021] Yaojie Lu, Hongyu Lin, Jin Xu, Xianpei Han, Jialong Tang, Annan Li, Le Sun, Meng Liao, and Shaoyi Chen.  Text2event: Controllable sequence-to-structure generation for end-to-end event extraction.  arXiv preprint arXiv:2106.09232, 2021.
  * Parrish et al. [2021] Alicia Parrish, Angelica Chen, Nikita Nangia, Vishakh Padmakumar, Jason Phang, Jana Thompson, Phu Mon Htut, and Samuel R Bowman.  Bbq: A hand-built bias benchmark for question answering.  arXiv preprint arXiv:2110.08193, 2021.
  * Qin et al. [2023] Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiaao Chen, Michihiro Yasunaga, and Diyi Yang.  Is chatgpt a general-purpose natural language processing task solver?  ArXiv, abs/2302.06476, 2023.
  * Radford et al. [2018] Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al.  Improving language understanding by generative pre-training.  2018\.
  * Rafailov et al. [2023] Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D Manning, and Chelsea Finn.  Direct preference optimization: Your language model is secretly a reward model.  arXiv preprint arXiv:2305.18290, 2023.
  * Ramamurthy et al. [2022] Rajkumar Ramamurthy, Prithviraj Ammanabrolu, Kianté Brantley, Jack Hessel, Rafet Sifa, Christian Bauckhage, Hannaneh Hajishirzi, and Yejin Choi.  Is reinforcement learning (not) for natural language processing?: Benchmarks, baselines, and building blocks for natural language policy optimization.  arXiv preprint arXiv:2210.01241, 2022.
  * Soni [2023] Vishvesh Soni.  Large language models for enhancing customer lifecycle management.  Journal of Empirical Social Science Studies, 7(1):67–89, 2023.
  * Sutton and Barto [2018] Richard S Sutton and Andrew G Barto.  Reinforcement learning: An introduction.  MIT press, 2018.
  * Vaswani et al. [2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin.  Attention is all you need.  Advances in neural information processing systems, 30, 2017.
  * Vilar et al. [2022] David Vilar, Markus Freitag, Colin Cherry, Jiaming Luo, Viresh Ratnakar, and George F. Foster.  Prompting palm for translation: Assessing strategies and performance.  ArXiv, abs/2211.09102, 2022.
  * Williams [1992] Ronald J Williams.  Simple statistical gradient-following algorithms for connectionist reinforcement learning.  Machine learning, 8:229–256, 1992.
  * Xu et al. [2023] Canwen Xu, Corby Rosset, Luciano Del Corro, Shweti Mahajan, Julian McAuley, Jennifer Neville, Ahmed Hassan Awadallah, and Nikhil Rao.  Contrastive post-training large language models on data curriculum.  arXiv preprint arXiv:2310.02263, 2023.
  * Ziegler et al. [2019] Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving.  Fine-tuning language models from human preferences.  arXiv preprint arXiv:1909.08593, 2019.


#  $L$-values of harmonic Maass forms

Nikolaos Diamantis  University of Nottingham
<EMAIL_ADDRESS>and  Larry Rolen  Vanderbilt University
<EMAIL_ADDRESS>
###### Abstract.

Bruinier, Funke, and Imamoglu have proved a formula for what can
philosophically be called the “central $L$-value” of the modular
$j$-invariant. Previously, this had been heuristically suggested by Zagier.
Here, we interpret this “$L$-value” as the value of an actual $L$-series, and
extend it to all integral arguments and to a large class of harmonic Maass
forms which includes all weakly holomorphic cusp forms. The context and
relation to previously defined $L$-series for weakly holomorphic and harmonic
Maass forms are discussed. These formulas suggest possible arithmetic or
geometric meaning of $L$-values in these situations. The key ingredient of the
proof is to apply a recent theory of Lee, Raji, and the authors to describe
harmonic Maass $L$-functions using test functions.

##  1\. Introduction

Some of the most important quantities associated to a modular form are its
Fourier coefficients and its $L$-values. Their Fourier coefficients give
important sequences in number theory, combinatorics, and physics, whereas
$L$-values often encode deep geometric and arithmetic information which is the
subject of conjectures such as those by Birch–Swinnerton-Dyer and by
Beilinson.

Particularly rich insight can be derived when $L$-values appear as Fourier
coefficients of other modular forms (e.g. in Shimura correspondence). A
situation of similar nature, in the setting of harmonic Maass forms, occurred
in [8], where a harmonic Maass form was constructed based on modular traces
and cycle integrals of weakly holomorphic modular forms. There, some of the
Fourier coefficients of the constructed harmonic Maass form were expressed as
the “central value” of an undefined “$L$-function” of a weakly holomorphic
form. That expression allowed for a geometric interpretation of those
coefficients.

We recall the expression established in [8], maintaining their notation. We
let $C_{Q}$ denote the imaginary axis and let $J(z):=j(z)-744$ be the
Hauptmodul for $\operatorname{SL}_{2}(\mathbb{Z})$. By analogy with the Mellin
transform expression for the value of a weight $k$ cusp form at $k/2$, the
authors of [8] define the “central $L$-value” of $J$ as the regularized
integral

(1.1) $\int_{C_{Q}}^{\mathrm{reg}}J(\tau)\frac{d\tau}{\tau}:=2\sum_{n\neq
0}a(n)\mathcal{EI}(2\pi n)$

where $\mathcal{EI}$ is the special function

(1.2)
$\mathcal{EI}(w):=\int_{w}^{\infty}e^{-t}\frac{dt}{t}=\begin{cases}E_{1}(w)\qquad\text{if
$w>0$}\\\ -\text{Ei}(-w)\quad\text{if $w<0$}.\end{cases}$

Here $E_{1}$ stands for the exponential integral (see (4.1) and (4.2) below
for the general definition of $E_{s}(z)$) and Ei for the “complementary”
exponential integral defined as the Cauchy principal value of the integral
(see §6.2(i) of [19]). Then, Th. 1.1 of [8] implies

(1.3)
$\int_{C_{Q}}^{\mathrm{reg}}J(\tau)\frac{d\tau}{\tau}=-\int_{i}^{i+1}J(\tau)\left(\psi(\tau)+\psi(1-\tau)\right)d\tau=-2\mathrm{Re}\left(\int_{i}^{i+1}J(\tau)\psi(\tau)d\tau\right),$

where $\psi(z)$ is the Euler Digamma function
$\psi(z):=\Gamma^{\prime}(z)/\Gamma(z).$ That expression generalized a formula
suggested to the authors of [8] by D. Zagier. More recently, a similar formula
was proved for general harmonic Maass forms in [1] in the context of their
work on a Shintani correspondence of harmonic Maass forms. In that work too,
the crucial element was an explicit characterization of the “central value” of
a hypothetical “$L$-function” attached to a harmonic Maass form.

As pointed out in [8] and [1], the reason that the above explicit formulas
could be considered as $L$-values only by analogy is that, at the time, there
was no systematic construction of $L$-series for harmonic Maass forms.
Recently, however, the authors jointly with M. Lee and W. Raji have defined
and studied actual $L$-series for general harmonic Maass forms ([11]). In this
paper, we will use the theory of [11] to interpret the expressions established
in [8] and [1] in the framework of a properly defined $L$-series. We will
further extend those explicit expressions beyond the “central value” to
include, in particular, all integer points.

The main results in their full generality will be given in Sections 4 and 5.
Here, we offer a special case for weakly holomorphic modular forms. To this
end, let

(1.4) $f(z)=\sum_{\begin{subarray}{c}n=-n_{0}\\\ n\neq
0\end{subarray}}^{\infty}a_{f}(n)e^{2\pi inz}$

be an element of $S_{k}^{!}(N)$, the space of weight $k$ weakly holomorphic
cusp forms, i.e., the space of weakly holomorphic modular forms with vanishing
constant terms at the cusps. For each $s,w\in\mathbb{C}$, let

$\varphi_{s}^{w}(t):=\mathbf{1}_{[1,\infty)}(t)e^{-wt}t^{s-1},\qquad\text{for
$t>0$.}$

where $\mathbf{1}_{S}$ denotes the characteristic function of
$S\subset\mathbb{R}$. Then we set

(1.5) $L_{f}(\varphi_{s}^{w}):=\sum_{\begin{subarray}{c}n=-n_{0}\\\ n\neq
0\end{subarray}}^{\infty}a_{f}(n)(\mathcal{L}\varphi_{s}^{w})(2\pi n)$

where $\mathcal{L}(g)$ denotes the standard Laplace transform of $g$ (see
(3.8) below). With this definition, we have the following result, where

$\zeta(s,a,z):=\sum_{m=0}^{\infty}e^{2\pi ima}(z+m)^{-s}$

is the Lerch zeta function.

######  Theorem 1.1.

Let $f\in S^{!}_{k}(N)$. Then, for each $s\in\mathbb{R}$ and each $w$ with
$\operatorname{Im}(w)>0$ we have

$L_{f}(\varphi_{s}^{w})=i^{-s}\int_{i}^{i+1}f(z)e^{iwz}\zeta\left(1-s,\frac{w}{2\pi},z\right)dz.$

As applications, we show Zagier-like formulas for forms of all weights $k$ and
integer $L$-values $s$ which generalize (1.3) of [8]. To describe this, for
$\varphi_{s}^{w}$ as above, set

(1.6) $L^{*}(f,s):=L_{f}(\varphi_{s}^{0})=\sum_{\begin{subarray}{c}n=-n_{0}\\\
n\neq 0\end{subarray}}^{\infty}a_{f}(n)E_{1-s}(2\pi n),$

(the star superscript added to indicate the analogy with the “completed”
version of the classical $L$-series, rather than with the $L$-series itself).
Then, in Section 5 we will prove the following formula, where $\zeta^{*}(a,z)$
denotes the constant term in the Laurent expansion at $s=a$ of the Hurwitz
zeta function $\zeta(s,z)=\zeta(s,0,z)$, i.e. $\zeta^{*}(a,z)$ equals
$\zeta(a,z)$, if $a\neq 1$, and $-\psi(z)$, when $a=1$.

######  Theorem 1.2.

Let $f\in S_{k}^{!}(N)$. Then for each $m\in\mathbb{Z}$, we have

$L^{*}(f,m)=i^{-m}\int_{i}^{i+1}f(z)\zeta^{*}\left(1-m,z\right)dz.$

######  Remark 1.1.

As explained in Remark 5.1 below, since $\zeta^{*}(1,a)=-\psi(a)$, Theorem 1.2
directly implies (1.3).

The geometric interpretation of the expression (1.3) established in [8],
combined with the systematic approach to $L$-series of harmonic Maass forms of
[11] that we apply here, suggests a deeper arithmetic meaning of the
$L$-values considered which is worth studying further.

##  2\. Context and motivation

As mentioned above, the Fourier coefficients and $L$-values of classical
holomorphic modular forms are fundamental invariants. For concreteness, let
$f(z)$ be a cusp form of weight $k$, having Fourier expansion
$f(z)=\sum_{n\geq 1}a_{f}(n)q^{n}$ with $q:=e^{2\pi iz}$. Then the $L$-series
for $f$ is defined for $\operatorname{Re}(s)>k+1/2$ by

$L(f,s):=\sum_{n\geq 1}\frac{a_{f}(n)}{n^{s}}.$

This has a functional equation relating the values at $s$ and $k-s$, and an
analytic continuation to $\mathbb{C}$. The critical $L$-values may also be
given by the following integral expressions:

(2.1)
$L(f,j+1)=\frac{(2\pi)^{j+1}}{j!}\int_{0}^{\infty}f(it)t^{j}dt,\quad\quad(1\leq
j\leq k-1).$

These integrals are often called the periods of $f$. While there is a vast
literature on the periods of holomorphic modular forms, little is known about
non-holomorphic extensions. However, there is growing evidence that $L$-series
in such cases arise in important connections with physics, and that an
arithmetic theory may be lurking. In particular, modular forms which have
exponential growth near the cusps play an increasingly important role in
applications. Often, physical theories require one to allow such
singularities. In this situation, integrals such as the right hand side of
(2.1) no longer make sense. The concept of renormalization in physics requires
mollifying divergent integrals ([13]) and it was a key ingredient in
Borcherds’ famous paper on automorphic forms with singularities on
Grassmannians [3]. Borcherds’ work was pivotal for the field of harmonic Maass
forms, including Bruinier and Ono’s construction of generalized Borcherds
products [9]. This has fundamental applications, for example the construction
of harmonic Maass forms which interpolate central critical $L$-values and
$L$-derivatives of elliptic curves.

Our work aims to begin a more systematic study of modular $L$-values when
there is exponential growth at the cusps. Recently, Lee, Raji, and the authors
developed [11] a new theory of $L$-series in such cases. The key idea was to
use a distributional definition, rather than think of $L$-series as functions
on $\mathbb{C}$. This distributional definition allowed the development of
structures that are critically important for holomorphic modular forms, e.g.
functional equations, converse theorems, Voronoi-type summation formulas.
Here, we apply the approach of [11] to study periods.

Several early hints on the structure of periods of weakly holomorphic modular
forms can be found in the literature. Much has been written about the traces
of singular moduli for weakly holomorphic forms, initiated by Zagier [20] and
related to the work of Borcherds [2]. For example, Zagier showed that the
generating function for the traces $tr_{d}(J)$ of $J(z)$ at discriminant $d<0$
CM points is the weakly holomorphic modular form

$-q^{-1}+2-248q^{3}+492q^{4}+\ldots\in M^{!}_{\frac{3}{2}}(\Gamma_{0}(4)).$

The analogous situation of positive discriminants gives rise to the theory of
cycle integrals, which Kohnen [15] and Kohnen-Zagier [16] showed to be closely
tied to certain period integrals of holomorphic modular forms. An important
work of Duke, Imamoglu, and Tóth [12] studied the cycle integrals of $J(z)$.
More recently, the “square discriminant” cases were studied by Bruinier,
Funke, and Imamoglu [8]. In the case of $J(z)$, this allowed them to prove a
formula, discovered heuristically by Zagier. This gave a cycle integral of
$J(z)$ in discriminant $1$, which philosophically can be thought of as a
critical $L$-value of $J(z)$:

$``L(J,0)"\ =\ 2\int_{1}^{\infty}J(z)\frac{dz}{z}=2\sum_{n\neq
0}a_{J}(n)\int_{2\pi
n}^{\infty}e^{-t}\frac{dt}{t}=-2\operatorname{Re}\left(\int_{i}^{i+1}J(z)\psi(z)dz\right).$

This work recasts the above formula in terms of genuine $L$-series associated
with weakly holomorphic forms according to the theory developed in [11]. As
outlined in Sect. 1, this leads to an extension to all integer (and, in some
cases, non-integer) values, and, further, to general harmonic Maass forms,
thereby re-interpreting an analogous formula of [1].

Our approach also sheds light to an earlier version of an $L$-series of weakly
holomorphic modular forms introduced in [6] and applied to various settings
(e.g. [4, 10]). That version, for a weight $k$ holomorphic cusp form $f$ with
Fourier expansion (1.4), was given by

(2.2) $\widetilde{L}_{f}(s):=\sum_{\begin{subarray}{c}n=-n_{0}\\\ n\neq
0\end{subarray}}^{\infty}a_{f}(n)E_{1-s}(2\pi
n)+i^{k}\sum_{\begin{subarray}{c}n=-n_{0}\\\ n\neq
0\end{subarray}}^{\infty}a_{f}(n)E_{1-k+s}(2\pi n).$

We observe that $\widetilde{L}_{f}(s)$, when $k=s=0,$ is similar to (1.1)
except that the former has been symmetrized to ensure it satisfies a
functional equation $s\to k-s$. Indeed, the first series in the RHS of (2.2),
i.e., the function $L^{*}(f,s)$ of Th. 1.2, does not satisfy a functional
equation. Instead, the behavior of this series (and, thus, of (1.1)) under the
transformation $s\to k-s$ is fully characterized once it is incorporated into
the framework of the $L$-series defined by (1.5). Interpreted in this way, it
does satisfy a functional equation which is stated and proved in Prop. 4.2
below. For this reason, we consider as our principal object the $L$-series
$L_{f}(\varphi_{s}^{w})$ and not $L^{*}(f,s)$. The latter is mainly introduced
to interpret our results in the setting of [8] and [1] which were the
inspiration of our work.

Another advantage of our method as applied here is that it formalizes the
regularization processes employed in both [8] and [6] (and [4]) thus
benefiting from the insight gained by their use. From this standpoint,
regularization amounts to evaluating $L$-series at _families of mappings_
instead of specific values, which, as seen in the present note, allows for
greater flexibility and for understanding the behavior under the
transformation $s\to k-s.$

The structure of the note is as follows. In the next section, we review the
theory of $L$-series associated with harmonic Maass cusp forms as introduced
in [11]. The main theorem (Th. 4.4) is formulated and proved in Section 4. In
Section 5, we apply Th. 4.4 to retrieve (1.3) of [8] and extend it to other
integer values. However, from our perspective, the “correct” viewpoint is to
consider Th. 4.4 as the actual extension of (1.3) of [8]. The results of Sect.
5 may appear more similar in form to (1.3), but they provide only part of the
information contained in Th. 4.4. Finally, in Section 6, we extend (1.3) of
[8] in a different direction, by evaluating our $L$-series at compactly
supported test functions and deriving a formula analogous to (1.3).

## Acknowledgments

We thank Kathrin Bringmann and Jorma Louko for very useful comments and
feedback on the manuscript. The first author is partially supported by EPSRC
grant EP/S032460/1. The second author is grateful for the support of a grant
from the Simons Foundation (853830, LR) and a 2021-2023 Dean’s Faculty
Fellowship from Vanderbilt University.

##  3\. Harmonic Maass cusp forms and their $L$-series

We recall the basic definitions and properties of harmonic Maass modular
forms. For simplicity, we will focus only on cuspidal forms in this paper.
These basic facts can all be found in Bruinier-Funke’s work [7]; see also [5]
for a general reference on harmonic Maass forms.

Let $\mathbb{H}$ denote the complex upper half-plane and set

$\mathbb{H}^{+}:=\\{w\in\mathbb{H};\operatorname{Re}(w)>0\\}\qquad\text{and}\,\,\,\mathbb{H}^{+}_{0}:=\\{w\in\mathbb{H};\operatorname{Re}(w)\geq
0\\}.$

For $k\in\mathbb{Z}$, we consider the action $|_{k}$ of
$\operatorname{SL}_{2}(\mathbb{R})$ on smooth functions
$f\colon\mathbb{H}\to\mathbb{C}$, given by

(3.1) $(f|_{k}\gamma)(z):=j(\gamma,z)^{-k}f(\gamma z),\qquad\text{for
$\gamma=\begin{pmatrix}a&b\\\ c&d\end{pmatrix}\in$ SL${}_{2}(\mathbb{R})$}.$

Here $\gamma z=\frac{az+b}{cz+d}$ is the Möbius transformation and
$j(\gamma,z):=cz+d.$ We also let $\Delta_{k}$ denote the weight $k$ hyperbolic
Laplacian on $\mathbb{H}$ given by

(3.2) $\Delta_{k}:=-4y^{2}\frac{\partial}{\partial
z}\frac{\partial}{\partial\bar{z}}+2iky\frac{\partial}{\partial\bar{z}},$

where $z=x+iy$ with $x,y\in\mathbb{R}$.

With this notation we state the following.

######  Definition 3.1.

Let $N\in\mathbb{N}$. A _harmonic Maass form of weight $k$ for
$\Gamma_{0}(N)$_ is a smooth function $f\colon\mathbb{H}\to\mathbb{C}$ such
that:

  1. i).

For all $\gamma\in\Gamma_{0}(N),$ we have $f|_{k}\gamma=f.$

  2. ii).

We have $\Delta_{k}(f)=0.$

  3. iii).

For each $\gamma=\left(\begin{smallmatrix}*&*\\\
c&d\end{smallmatrix}\right)\in\operatorname{SL}_{2}(\mathbb{Z})$, there is a
polynomial $P(z)\in\mathbb{C}[q^{-1}],$ such that

$f(\gamma z)(cz+d)^{-k}-P(z)=O(e^{-\varepsilon y}),\qquad\text{as
$y\to\infty$, for some $\varepsilon>0.$}$

We let $H_{k}(N)$ denote the space of harmonic Maass forms with weight $k$ for
$\Gamma_{0}(N)$.

To describe the Fourier expansions of the elements of $H_{k}(N)$, we recall
the definition and the asymptotic behavior of the incomplete Gamma function.
For $r,z\in\mathbb{C}$ with $\operatorname{Re}(r)>0$, we define the incomplete
Gamma function as

(3.3) $\Gamma(r,z):=\int_{z}^{\infty}e^{-t}t^{r}\,\frac{dt}{t}.$

When $z\neq 0$, $\Gamma(r,z)$ is an entire function of $r$ (see [19]
§8.2(ii)). We note the asymptotic relation for $x\in\mathbb{R}$ (see (8.11.2)
of [19]):

(3.4) $\Gamma(s,x)\sim x^{s-1}e^{-x}\qquad\text{as $|x|\to\infty.$ }$

With this notation we can state the following theorem.

######  Theorem 3.2 ([7]).

Let $k\in\mathbb{Z}.$ For each $f\in H_{k}(N)$, we have

(3.5) $f(z)=\sum_{\begin{subarray}{c}n\geq-n_{0}\end{subarray}}a_{f}(n)e^{2\pi
inz}+\sum_{\begin{subarray}{c}n<0\end{subarray}}b_{f}(n)\Gamma(1-k,-4\pi
ny)e^{2\pi inz}$

for some $a_{f}(n),b_{f}(n)\in\mathbb{C}$ and $n_{0}\in\mathbb{N}.$ Analogous
expansions hold at the other cusps.

The first sum is sometimes called the “holomorphic part” of $f$ and the
second, the “non-holomorphic part.”

The subspace we will be dealing with, for simplicity, in this paper is the
space $HC_{k}(N)$ of _harmonic Maass cusp forms of weight $k$ and level $N$_.
It consists of $f\in H_{k}(N)$ which have vanishing constant terms at all
cusps. Another subspace of particular importance is the space $S_{k}^{!}(N)$
of _weakly holomorphic cusp forms with weight $k\in\mathbb{Z}$ and level $N$_.
It consists of $f\in HC_{k}(N)$ that are holomorphic on $\mathbb{H}.$

The growth of the coefficients $a_{f}(n),b_{f}(n)$ of $f$ in (3.5) is given by

(3.6) $a_{f}(n),b_{f}(-n)=O\left(e^{C_{f}\sqrt{n}}\right),\qquad\text{as
$n\to\infty$ for some $C_{f}>0$}.$

We next recall an important mapping sending forms of weight $k$ to forms of
weight $2-k$: Let $f$ be an element of $HC_{k}$ with Fourier expansion (3.5)
and set

$(\xi_{k}f)(z):=2iy^{k}\overline{\frac{\partial f}{\partial\bar{z}}}.$

Then, this induces a surjective map

$\xi_{k}\colon HC_{k}(N)\twoheadrightarrow S_{2-k}(N),$

and the output cusp form has Fourier expansion given explicitly by

(3.7) $(\xi_{k}f)(z)=-\sum_{n<0}(-4\pi n)^{1-k}\overline{b_{f}(n)}e^{-2\pi
inz}.$

An implication of this fact is that, when $k\geq 2$, $\xi_{k}f$ vanishes
(since then $S_{2-k}(N)=\\{0\\}$) and thus, $f$ is a weakly holomorphic cusp
form.

Finally, $f^{c}$ will denote the harmonic Maass form obtained by taking the
complex conjugate of the coefficients of $f$, i.e.,

$f^{c}(z):=\overline{f(-\bar{z})}.$

We will now recall the $L$-series attached to harmonic Maass cusp forms as
defined in [11]. We require some additional definitions to describe the set-
up. Let $C(\mathbb{R},\mathbb{C})$ be the space of piece-wise smooth complex-
valued functions on $\mathbb{R}$. Let $\mathcal{L}$ be the Laplace transform
mapping each $\varphi\in C(\mathbb{R},\mathbb{C})$ to

(3.8) $(\mathcal{L}\varphi)(s):=\int_{0}^{\infty}e^{-st}\varphi(t)dt$

for each $s\in\mathbb{C}$ for which the integral converges absolutely.

For each function $f:\mathbb{H}\to\mathbb{C}$ given by an absolutely
convergent series of the shape

(3.9) $f(z)=\sum_{\begin{subarray}{c}n\geq-n_{0}\\\ n\neq
0\end{subarray}}a_{f}(n)e^{2\pi
inz}+\sum_{\begin{subarray}{c}n<0\end{subarray}}b_{f}(n)\Gamma(1-k,-4\pi
ny)e^{2\pi inz}$

for some $k\in\mathbb{Z}$ and a $n_{0}\in\mathbb{N}$, let $\mathcal{F}_{f}$ be
the space of functions $\varphi\in C(\mathbb{R},\mathbb{C})$ such that the
following series converges:

(3.10) $\sum_{\begin{subarray}{c}n\geq-n_{0}\\\ n\neq
0\end{subarray}}|a_{f}(n)|(\mathcal{L}|\varphi|)\left(2\pi
n\right)+\sum_{n<0}|b_{f}(n)|\left(4\pi|n|\right)^{1-k}\int_{0}^{\infty}\frac{(\mathcal{L}|\varphi_{2-k}|)\left(-2\pi
n(2t+1)\right)}{(1+t)^{k}}dt.$

######  Remark 3.1.

For the functions $f$ we will be considering, the space $\mathcal{F}_{f}$
contains the compactly supported functions.

A useful expression for the “non-holomorphic” part of the series is (cf.
(4.14) of [11]):

(3.11) $\left(-4\pi
n\right)^{1-k}\int_{0}^{\infty}\frac{\mathcal{L}\varphi_{2-k}\left(-2\pi
n(2t+1)\right)}{(1+t)^{k}}dt=\int_{0}^{\infty}\Gamma\left(1-k,-4\pi
ny\right)e^{-2\pi ny}\varphi(y)dy.$

With this notation, we are now able to define our $L$-series and recall some
basic facts on them, which were given in [11].

######  Definition 3.3.

Let $f$ be a function on $\mathbb{H}$ given by the Fourier expansion (3.9).
The $L$-series of $f$ is defined to be the map
$L_{f}\colon\mathcal{F}_{f}\to\mathbb{C}$ such that, for
$\varphi\in\mathcal{F}_{f}$,

$\displaystyle L_{f}(\varphi)=$ $\displaystyle\sum_{n\geq-
n_{0}}a_{f}(n)(\mathcal{L}\varphi)(2\pi n)$
$\displaystyle+\sum_{n<0}b_{f}(n)(-4\pi
n)^{1-k}\int_{0}^{\infty}\frac{(\mathcal{L}\varphi_{2-k})(-2\pi
n(2t+1))}{(1+t)^{k}}dt.$

The analogue of Mellin transform expression for this $L$-series is the
following.

######  Lemma 3.4.

Let $f$ be a function on $\mathbb{H}$ as a series in (3.9). For
$\varphi\in\mathcal{F}_{f}$, the $L$-series $L_{f}(\varphi)$ can be written as

$L_{f}(\varphi)=\int_{0}^{\infty}f(iy)\varphi(y)dy.$

Before stating the functional equation of $L_{f}$ for $f\in HC_{k}(N)$, we
introduce the action of a Fricke involution in this setting. For each
$a\in\mathbb{Z},$ $M\in\mathbb{N}$ and
$\varphi\colon\mathbb{R}_{>0}\to\mathbb{C}$, we define

(3.12)
$(\varphi|_{a}W_{M})(x):=(Mx)^{-a}\varphi\left(\frac{1}{Mx}\right)\qquad\text{for
all $x>0$}.$

######  Remark 3.2.

The reader should note that there is a change in sign convention from earlier
in this paper, when $W_{M}$ was considered to act on functions on
$\mathbb{H}$.

With this notation in mind, the final result about our $L$-series that we
require is the following functional equation, proved, in more generality, in
[11] (Th. 4.3).

######  Theorem 3.5.

Fix $k\in\mathbb{Z}$ and $N\in\mathbb{N}$. Suppose that $f$ is an element of
$HC_{k}(N)$ with expansion (3.9). Consider the map
$L_{f}\colon\mathcal{F}_{f}\to\mathbb{C}$ given by Definition 3.3. Set

$g:=f|_{k}W_{N}$

and

$\mathcal{F}_{f,g}:=\left\\{\varphi\in\mathcal{F}_{f}\;:\;\varphi|_{2-k}W_{N}\in\mathcal{F}_{g}\right\\}.$

Then $\mathcal{F}_{f,g}\neq\\{0\\}$ and, for each
$\varphi\in\mathcal{F}_{f,g}$ we have

$L_{f}(\varphi)=i^{k}N^{1-k/2}L_{g}(\varphi|_{2-k}W_{N}),$

##  4\. The main formula

The basic definitions and structure of harmonic Maass cusp forms and their
$L$-series having been set up, we are nearly in position to begin deriving our
main result, Theorem 4.4. Firstly, however, we require some notation and basic
facts about the generalized exponential integral.

For $\operatorname{Re}(z)>0$, we define the generalized exponential integral
by

(4.1)
$E_{s}(z):=z^{s-1}\Gamma(1-s,z)=\int_{1}^{\infty}\frac{e^{-zt}}{t^{s}}dt$

The function $E_{s}(z)$ has an analytic continuation to
$\mathbb{C}-(-\infty,0]$ as a function of $z$ to give the _principal branch_
of $E_{s}(z)$. With (8.19.8) and (8.19.10) of [19], this analytic continuation
can be given by the formula:

(4.2) $E_{s}(z)=\begin{cases}z^{s-1}\Gamma(1-s)-\sum\limits_{0\leq
k}\frac{(-z)^{k}}{k!(1-s+k)}\qquad&\text{for $s\in\mathbb{C}-\mathbb{N}$},\\\
\frac{(-z)^{s-1}}{(s-1)!}(\psi(s)-\text{Log}(z))-\sum\limits_{0\leq k\neq
s-1}\frac{(-z)^{k}}{k!(1-s+k)}\qquad&\text{for $s\in\mathbb{N}$}.\end{cases}$

Since the two series on the right hand side give entire functions, (4.2)
allows us to continuously extend each function $E_{s}(z)$ to
$\mathbb{R}_{<0}$, once we select a branch for the (implied) logarithm. We
will fix this branch to be the principal one.

The function $E_{s}(z)$ differs from $\mathcal{EI}(z)$ only in the values in
$\mathbb{R}_{<0}.$ Specifically, by (6.2.7) [19], for $n<0$, we have

(4.3) $\mathcal{EI}(2\pi n)=-\text{Ei}(-2\pi n)=\text{Ein}(2\pi
n)-\text{Log}(-2\pi n)-\gamma=E_{1}(2\pi n)+\pi i,$

where $\mathrm{Ein}(z):=\int_{0}^{z}\frac{1-e^{-t}}{t}dt$ is the complementary
exponential integral. By (8.11.2) of [19], we also have the bound

(4.4) $E_{s}(z)=O(e^{-z}),\qquad\text{ as $z\to\infty$ in the wedge
$\arg(z)<3\pi/2.$}$

Now for $k\in\mathbb{Z}$ let $f\in HC_{k}(N)$ be a harmonic Maass cusp forms
of weight $k$ for $\Gamma_{0}(N)$. Set $g:=f|_{k}W_{N}.$ Exactly as in the
classical case, we can show that $g\in HC_{k}(N)$ and therefore, $g$ will have
a Fourier expansion of the form (3.9). We then define

$\varphi_{s}^{w}(t):=\mathbf{1}_{[1,\infty)}(t)e^{-wt}t^{s-1},\qquad\text{for
$t>0$}.$

Using this, we show the following basic lemma which shows the suitability of
our test function for convergence.

######  Lemma 4.1.

With the above notation, for each $w$ with $x:=\operatorname{Re}(w)>\max(2\pi
n_{0},C_{g}^{2}N/(2\pi))$ and $s\in\mathbb{C}$, the map
$\varphi_{s}^{w}\colon\mathbb{R}_{>0}\to\mathbb{C}$ belongs to
$\mathcal{F}_{f,g}.$

###### Proof.

For each $n\geq-n_{0}$ we have

$\mathcal{L}(|\varphi_{s}^{w}|)(2\pi n)=\int_{1}^{\infty}e^{-2\pi nt-
xt}t^{\sigma-1}dt=E_{1-\sigma}(2\pi n+x),$

where $\sigma:=\operatorname{Re}(s).$ Thus, with (4.4) and (3.6), the series

$\sum_{\begin{subarray}{c}n\geq-
n_{0}\end{subarray}}|a_{f}(n)|\mathcal{L}(|\varphi_{s}^{w}|)\left(2\pi
n\right)$

converges. Furthermore, we have
$|(\varphi_{s}^{w})_{2-k}|=\varphi_{\sigma-k+1}^{x}=(\varphi_{\sigma}^{x})_{2-k}$
and hence, by (3.4), we have

(4.5) $\displaystyle\int_{1}^{\infty}\Gamma\left(1-k,-4\pi ny\right)e^{-(2\pi
ny+x)y}y^{\sigma+1}dy$
$\displaystyle\ll\int_{1}^{\infty}e^{-(2\pi|n|+x)y}y^{\sigma-1-k}dy$
$\displaystyle=O\left(e^{-C_{1}|n|}\right),\quad(\text{as }n\to-\infty).$

Using (3.6) and (3.11), we deduce that the second series of (3.10) converges.
Therefore, $\varphi_{s}^{w}\in\mathcal{F}_{f}$.

On the other hand,

(4.6)
$(\varphi_{s}^{w}|_{2-k}W_{N})(t)=\varphi_{s}^{w}(1/(Nt))(Nt)^{k-2}=\mathbf{1}_{(0,1/N]}(t)e^{-w/(Nt)}(Nt)^{k-s-1},\qquad\text{for
$t>0$}.$

Hence, $|\varphi_{s}^{w}|_{2-k}W_{N}|=|\varphi_{\sigma}^{x}|\,|_{2-k}W_{N}$.
Therefore, we have

$\mathcal{L}\left(\Big{|}\varphi_{s}^{w}|_{2-k}W_{N}\Big{|}\right)(2\pi
n)=\int_{0}^{1/N}e^{-2\pi
nt-\frac{x}{Nt}}t^{k-1-\sigma}dt=(x/N)^{k-\sigma}\int_{x}^{\infty}e^{-t-\frac{2\pi
nx}{Nt}}t^{\sigma-k-1}dt.$

It is clear that the final integral converges for each $n\in\mathbb{Z}$ and
that, if $n>0$, it is bounded from above by

$(x/N)^{k-\sigma}\int_{0}^{\infty}e^{-t-\frac{2\pi
nx}{Nt}}t^{\sigma-k-1}dt=2\left(\frac{2\pi
nN}{x}\right)^{\frac{\sigma-k}{2}}K_{k-\sigma}\left(2\sqrt{\frac{2\pi
nx}{N}}\right)$

where $K_{s}(z)$ is the standard K-Bessel function. Then, using (10.40.2) of
[19], we deduce that, for $n>0$,

$\mathcal{L}\left(\Big{|}\varphi_{s}^{w}|_{2-k}W_{N}\Big{|}\right)(2\pi n)\ll
e^{-2\sqrt{\frac{2\pi nx}{N}}}n^{\frac{\sigma-k-1}{2}}.$

Using the bound (3.6) and that $x>C_{g}^{2}N/(2\pi)$, we find that the series

$\sum_{\begin{subarray}{c}n\geq-
n_{0}\end{subarray}}|a_{g}(n)|\mathcal{L}\left(\Big{|}\varphi_{s}^{w}|_{2-k}W_{N}\Big{|}\right)\left(2\pi
n\right)$

converges. Further, by (4.6) we have

$\left|\left(\varphi_{s}^{w}|_{2-k}W_{N}\right)_{2-k}(t)\right|=\mathbf{1}_{[0,1/N)}(t)e^{-x/(Nt)}N^{k-\sigma-1}t^{-\sigma}$

and thus, for $n<0,$ we compute

(4.7)
$\int_{0}^{\infty}\frac{(\mathcal{L}|(\varphi_{s}^{w}|_{2-k}W_{N})_{2-k}|)\left(-2\pi
n(2t+1)\right)}{(1+t)^{k}}dt\\\
=\int_{0}^{\infty}\frac{1}{(1+t)^{k}}\int_{0}^{\frac{1}{N}}N^{k-\sigma-1}y^{-\sigma}e^{-\frac{x}{Ny}-2\pi|n|(2t+1)y}dydt\\\
=\int_{0}^{\infty}\frac{N^{k-2}x^{1-\sigma}}{(1+t)^{k}}\int_{x}^{\infty}y^{\sigma-2}e^{-y-\frac{2\pi|n|(2t+1)x}{Ny}}dydt$

where, for the inner integral we applied the change of variables $y\to
x/(Ny).$ The inner integral is bounded from above by

$2\left(\sqrt{\frac{2\pi|n|(2t+1)x}{N}}\right)^{\sigma-1}K_{1-\sigma}\left(\sqrt{\frac{8\pi|n|(2t+1)x}{N}}\right)\ll(|n|(2t+1))^{\frac{2\sigma-3}{4}}e^{-\sqrt{\frac{8\pi
x}{N}}\sqrt{|n|(2t+1)}}$

as $n\to-\infty$, where we also made use of (10.40.2) of [19]. The basic
inequality

$-\sqrt{|n|(2t+1)}\leq\frac{-1}{2}\sqrt{|n|}+\frac{-1}{2}\sqrt{(2t+1)}$

then gives

(4.8) $\sum_{n<0}b_{g}(n)(-4\pi
n)^{1-k}\int_{0}^{\infty}\frac{(\mathcal{L}|(\varphi_{s}^{w}|_{2-k}W_{N})_{2-k}|)(-2\pi
n(2t+1))}{(1+t)^{k}}dt\\\
\ll\sum_{n<0}|b_{g}(n)||n|^{\frac{2\sigma+1-4k}{4}}e^{-\sqrt{\frac{2\pi
x|n|}{N}}}\int_{0}^{\infty}\frac{e^{-\sqrt{\frac{2\pi
x(2t+1)}{N}}}}{(1+t)^{k-\frac{\sigma}{2}+\frac{3}{4}}}dt$

By (3.6) this converges for $x>C^{2}_{g}N/(2\pi)$, which proves that
$\varphi_{s}^{w}|_{2-k}W_{N}\in\mathcal{F}_{g}$. ∎

This lemma allows us to apply Theorem 4.5 of [11] to deduce our functional
equation.

######  Proposition 4.2.

Fix $k\in\mathbb{Z}$ and $N\in\mathbb{N}$. Suppose that $f$ is an element of
$HC_{k}(N)$ and that $g=f|_{k}W_{N}$ with expansions (3.9). Further suppose
that $C_{f},C_{g}$ are positive constants such that (3.6) holds. Then, for
each $w$ with $\operatorname{Re}(w)>\max(2\pi n_{0},NC_{g}^{2}/{(2\pi)})$ and
for each $s\in\mathbb{C}$, we have

$L_{f}(\varphi_{s}^{w})=i^{k}N^{1-\frac{k}{2}}L_{g}(\varphi_{s}^{w}|_{2-k}W_{N}).$

We now prove a lemma that extends the crucial identity employed in the proof
of Th. 3.2 of [8]. Here and in the sequel, the implied branch of the logarithm
is the principal one.

######  Lemma 4.3.

For each $w\in\mathbb{H},$ we have

(4.9) $i^{a}E_{1-a}(w)=\int_{i}^{i+\infty}e^{iwz}z^{a-1}dz.$

for all $a\in\mathbb{R}.$ If $\operatorname{Im}(w)=0$ and
$\operatorname{Re}(w)>0$, then (4.9) holds for all $a<0.$

###### Proof.

Let $w\in\mathbb{C}$ be such that $\operatorname{Im}(w)\geq 0.$ We first
assume that $\operatorname{Re}(w)>0.$ Then, for $T>1$,

$i^{a}\int_{1}^{T}e^{-wt}t^{a-1}dt=\int_{i}^{iT}e^{iwz}z^{a-1}dz=\left(\int_{i}^{i+T}+\int_{i+T}^{iT+T}+\int_{iT+T}^{iT}\right)e^{iwz}z^{a-1}dz.$

We consider the last two integrals in turn. We first bound the third integral:

$\int_{iT+T}^{iT}e^{iwz}z^{a-1}dz=\int_{T}^{0}e^{iw(iT+t)}(iT+t)^{a-1}dt\ll
T^{a}e^{-\operatorname{Re}(w)T}\int_{0}^{1}|i+t|^{a-1}dt.$

This vanishes as $T\to\infty.$ For the second integral we have

(4.10)
$\int_{i+T}^{iT+T}e^{iwz}z^{a-1}dz=ie^{iwT}\int_{1}^{T}e^{-wt}(T+it)^{a-1}dt\ll
e^{-\operatorname{Im}(w)T}\int_{1}^{T}|T+it|^{a-1}dt$

If $\operatorname{Im}(w)>0$, this vanishes as $T\to\infty,$ for all
$a\in\mathbb{R}.$ If $\operatorname{Im}(w)=0$ and $a<0$, it is bounded from
above by $\int_{1}^{\infty}(T^{2}+1)^{(a-1)/2}dt$ which also vanishes as
$T\to\infty.$

Therefore, under the conditions of the lemma and, if $\operatorname{Re}(w)>0$,
we have

$\displaystyle i^{a}E_{1-a}(w)$
$\displaystyle=i^{a}\int_{1}^{\infty}e^{-wt}t^{a-1}dt$
$\displaystyle=\lim_{T\to\infty}\left(\int_{i}^{i+T}+\int_{i+T}^{iT+T}+\int_{iT+T}^{iT}\right)e^{iwz}z^{a-1}dz=\int_{i}^{i+\infty}e^{iwz}z^{a-1}dz+0+0.$

By the remarks on the analytic continuation of $E_{1-a}(w)$ in the beginning
of the section, we see that both sides of (4.9) are analytic in
$\\{w\in\mathbb{C};\operatorname{Im}(w)>0\\}$. Therefore, by the identity
theorem, we deduce that (4.9) remains true for all $w$ with
$\operatorname{Im}(w)>0.$ ∎

We can now prove our main formula for $L_{f}(\varphi_{s}^{w})$. We assume that
$w\in\mathbb{H}$ and, in the first instance, that
$\operatorname{Re}(w)>\max(2\pi n_{0},C_{g}^{2}N/(2\pi))$. By Lemma 4.1 ,
$L_{f}(\varphi_{s}^{w})$ is well-defined for all $s\in\mathbb{R}$. Using
(3.11), we split up the $L$-value as

(4.11) $L_{f}(\varphi_{s}^{w})=I_{1}+I_{2},$

where

$\displaystyle I_{1}$ $\displaystyle:=\sum_{\begin{subarray}{c}n\geq-n_{0}\\\
n\neq 0\end{subarray}}a_{f}(n)(\mathcal{L}\varphi_{s}^{w})\left(2\pi
n\right)=\sum_{\begin{subarray}{c}n\geq-n_{0}\\\ n\neq
0\end{subarray}}a_{f}(n)\int_{1}^{\infty}e^{-(2\pi n+w)t}t^{s-1}dt$

and

$\displaystyle I_{2}:$
$\displaystyle=\sum_{n<0}b_{f}(n)\int_{0}^{\infty}\Gamma\left(1-k,-4\pi
nt\right)e^{-2\pi nt}\varphi_{s}^{w}(t)dt$
$\displaystyle=\sum_{n<0}b_{f}(n)\int_{1}^{\infty}\Gamma\left(1-k,-4\pi
nt\right)e^{-(2\pi n+w)t}t^{s}\frac{dt}{t}.$

By Lemma 4.3, applied with $2\pi n+w$ and $s$ in place of $w$ and $a$
respectively, we deduce that

$I_{1}=i^{-s}\sum_{\begin{subarray}{c}n\geq-n_{0}\\\ n\neq
0\end{subarray}}a_{f}(n)\int_{i}^{i+\infty}e^{i(2\pi n+w)z}z^{s-1}dz.$

We now turn to $I_{2}$. For each $n<0$, it is easy to see (first for
$\operatorname{Re}(w)>-2\pi n$ and, by analytic continuation for all
$w\in\mathbb{H}^{+}_{0}$), that

$\displaystyle\int_{1}^{\infty}\Gamma\left(1-k,-4\pi nt\right)e^{-(2\pi
n+w)t}t^{s}\frac{dt}{t}$ $\displaystyle\qquad\qquad=\Gamma(1-k,-4\pi
n)E_{1-s}(2\pi n+w)-(-4\pi n)^{1-k}\int_{1}^{\infty}e^{4\pi
nt}t^{s-k}E_{1-s}((2\pi n+w)t)dt.$

With Lemma 4.3, this becomes

$i^{-s}\Gamma(1-k,-4\pi n)\int_{i}^{i+\infty}e^{i(2\pi
n+w)z}z^{s}\frac{dz}{z}-(-4\pi n)^{1-k}\int_{1}^{\infty}e^{4\pi
nt}t^{s-k}E_{1-s}((2\pi n+w)t)dt.$

Since $w\in\mathbb{H}^{+},$ the bounds (3.6), (3.4) and (4.4) imply that we
can interchange summation and integration in $I_{1}$ and $I_{2}$ to deduce
that $L_{f}(\varphi_{s}^{w})$ equals

(4.12) $i^{-s}\int_{i}^{i+\infty}f(z)e^{iwz}z^{s-1}dz-\sum_{n<0}b_{f}(n)(-4\pi
n)^{1-k}\int_{1}^{\infty}e^{4\pi nt}t^{s-k}E_{1-s}((2\pi n+w)t)dt.$

Here and in the sequel, the path of integration of the first integral is fixed
to be $\\{i+t;t\in\mathbb{R}_{>0}\\}$ so that $\operatorname{Im}(z)=1.$

The first term of the right hand side of (4.12) can be expressed as an
integral over a finite interval as follows:

(4.13)
$i^{-s}\sum_{m=0}^{\infty}\int_{i+m}^{i+m+1}f(z)e^{iwz}z^{s-1}dz=i^{-s}\int_{i}^{i+1}f(z)e^{iwz}\zeta\left(1-s,\frac{w}{2\pi},z\right)dz.$

The values of the parameters that appear in (4.12) belong to the domain of
absolute convergence of the defining series of $\zeta(s,a,c)$.

The second term of the right hand side of (4.12) does not appear if $f$ is
weakly holomorphic, but, when it does, it can be explicitly computed for
integer values of $s.$ This will be done in the next section. However, it can
also be written as an integral over the same finite interval in terms of
$\xi_{k}f$, to give a more unified appearance to the general formula of
$L_{f}(\varphi_{s}^{w}).$ Specifically, as above, we can apply Lemma 4.3 to
$E_{1-s}((2\pi n+w)t)$ and, since, for $w\in\mathbb{H}^{+}_{0},$ it is
legitimate to interchange the order of integration, we obtain

$\int_{1}^{\infty}e^{4\pi nt}t^{s-k}E_{1-s}((2\pi
n+w)t)dt=i^{-s}\int_{i}^{i+\infty}\int_{1}^{\infty}e^{i(2\pi n+w)tz+4\pi
nt}z^{s-1}t^{s-k}dtdz.$

Applying (3.7), we deduce that

(4.14) $R(w,s):=-\sum_{n<0}b_{f}(n)(-4\pi n)^{1-k}\int_{1}^{\infty}e^{4\pi
nt}t^{s-k}E_{1-s}((2\pi n+w)t)dt\\\
=i^{-s}\int_{i}^{i+\infty}\int_{1}^{\infty}(\xi_{k}f^{c})(t(2i-z))e^{itzw}t^{s-k}z^{s-1}dtdz=i^{-s}\int_{i}^{i+1}\int_{1}^{\infty}e^{itzw}t^{s-k}R_{t}(z,w)dtdz,$

where

(4.15)
$R_{t}(z,w):=\sum_{m=0}^{\infty}\frac{(\xi_{k}f^{c})(t(2i-z-m))}{(z+m)^{1-s}}e^{itmw}.$

It is routine to check that interchanges of summation and integrations are
justified once we recall that $\xi_{k}f^{c}$ is a holomorphic cusp form.

We now note that (4.12) defines an analytic function in $\mathbb{H}^{+}$ with
a continuous extension to $\mathbb{H}^{+}_{0}.$ Indeed, the Lerch zeta
function is analytic in the region it is evaluated in and the second term of
(4.12) is shown in (4.14) to equal an analytic function of
$w\in\mathbb{H}^{+}$ with a continuous extension to $\mathbb{H}^{+}_{0}$.
Further, for fixed $s$, $L_{f}(\varphi_{s}^{w})$ can be analytically
continued, as a function of $w$, to an open set containing
$\mathbb{H}^{+}_{0}$: By (4.11), we have that, for all $w\in\mathbb{H}$ with
$\operatorname{Re}(w)>\max(2\pi n_{0},C_{g}^{2}N/(2\pi))$, we have

(4.16) $L_{f}(\varphi_{s}^{w})=\sum_{\begin{subarray}{c}n\geq-n_{0}\\\ n\neq
0\end{subarray}}a_{f}(n)E_{1-s}\left(2\pi n+w\right)+I_{2}.$

The first series in the right hand side of (4.16) converges in compacta for
$w\in\mathbb{H}$, because each term is well-defined and, by (3.6) and (4.4),

$a_{f}(n)E_{1-s}\left(2\pi n+w\right)\ll e^{C_{f}\sqrt{n}-2\pi
n}\qquad\text{as $n\to\infty$.}$

Further, by two applications of (3.4), we see that, for $w$ in a compact
subset of $\mathbb{H}^{+}_{0}$, we have that, for some $K>0,$

$\int_{0}^{\infty}\Gamma\left(1-k,-4\pi nt\right)e^{-2\pi
nt}\varphi_{s}^{w}(t)dt\ll e^{Kn}\qquad\text{as $n\to-\infty$.}$

Therefore, both series in (4.16) can be analytically continued to
$\mathbb{H}^{+}$ with a continuous extension to $\mathbb{H}^{+}_{0}$.

Since, as we proved above, $L_{f}(\varphi_{s}^{w})$ equals (4.12) when
$\operatorname{Re}(w)>\max(2\pi n_{0},C_{g}^{2}N/(2\pi))$ and
$\operatorname{Im}(w)>0$, by analytic continuation and continuity we have
shown our main result:

######  Theorem 4.4.

Let $f\in HC_{k}(N)$. Then, for each $s\in\mathbb{R}$ and each
$w\in\mathbb{H}^{+}_{0}$, we have

$L_{f}(\varphi_{s}^{w})=i^{-s}\int_{i}^{i+1}\left(f(z)e^{iwz}\zeta\left(1-s,\frac{w}{2\pi},z\right)+\int_{1}^{\infty}e^{itzw}t^{s-k}R_{t}(z,w)dt\right)dz$

where the path of integration of the outer integral is fixed to be
$\\{i+t;t\in[0,1]\\}$ Here
$\varphi_{s}^{w}(t)=\mathbf{1}_{[1,\infty)}(t)e^{-wt}t^{s-1}$, $\zeta(s,a,c)$
is the Lerch zeta function and $R_{t}$ is defined by (4.15).

######  Remark 4.1.

As $S_{k}^{!}(N)\subset HC_{k}(N)$ and the restriction to
$w\in\mathbb{H}^{+}_{0}$ is required only for the treatment of the “non-
holomorphic part” of $f$, Theorem 4.4 includes Theorem 1.1 as a special case.

##  5\. The values of $L^{*}(f,s)$

In this section, we will apply the general set up and main theorem we proved
in the last section to evaluate values at specific $s\in\mathbb{R}$. We will
treat separately the following cases: $s=0$ (which corresponds to the setting
considered in [8]), $s=1+m$, with $m\in\mathbb{N}_{0}$ and $s<0$ (not
necessarily integral). Those cases together imply Th. 1.2. These results could
be extended to all harmonic Maass forms but we will do so only in the case of
$s=1+m$ with $m\in\mathbb{N}_{0}$, because the technicalities considerably
increase in the other cases, due to the presence of infinite sums, without
adding any substantially new idea.

###  5.1. The case $s=0$

We first retrieve the “$L$-value” and its formula discussed in [8]. As
mentioned in the introduction, given a weakly holomorphic modular form $g$ ,
the authors of [8] constructed a series of the form (1.1) which is crucial for
their main result and which can be thought off as a “central $L$-value” of
$g$, although no $L$-series is defined there. Within our framework, this now
becomes an actual $L$-value.

Specifically, as mentioned above, if $f$ is a weakly holomorphic cusp form,
then for each $s\in\mathbb{R},$ $L_{f}(\varphi_{s}^{w})$ has an analytic
continuation to $\mathbb{H}$ and it is continuously extendable to
$\mathbb{R}-\\{2\pi n;n=\pm 1,\pm 2,\dots\\}$. This implies that, for each
$s\in\mathbb{R},$ $L_{f}(\varphi_{s}^{0})$ is well-defined and, for $s=0$, it
equals the $L$-value $L^{*}(f,0)$ as defined in (1.6).

On the other hand, Th. 4.4 implies that, for $x>0$,

$L_{f}(\varphi_{0}^{ix})=\int_{i}^{i+1}f(z)e^{-xz}\zeta\left(1,\frac{ix}{2\pi},z\right)dz.$

Since $f$ has a vanishing constant term in its Fourier expansion, we have

(5.1) $\int_{i}^{i+1}f(z)dz=0.$

Therefore,

$\displaystyle\int_{i}^{i+1}f(z)e^{-xz}\zeta\left(1,\frac{ix}{2\pi},z\right)dz=\int_{i}^{i+1}$
$\displaystyle
f(z)e^{-xz}\left(\zeta\left(1,\frac{ix}{2\pi},z\right)-\zeta\left(1,\frac{ix}{2\pi},1\right)\right)dz$
$\displaystyle+$
$\displaystyle\int_{i}^{i+1}f(z)(e^{-xz}-1)\zeta\left(1,\frac{ix}{2\pi},1\right)dz.$

We now observe that
$\zeta\left(1,\frac{ix}{2\pi},1\right)=-e^{x}\log(1-e^{-x}),$ and hence

(5.2)
$(e^{-xz}-1)\zeta\left(1,\frac{ix}{2\pi},1\right)=\frac{e^{-xz}-1}{e^{-x}-1}e^{x}(1-e^{-x})\log(1-e^{-x})\to
0\quad(\text{as $x\to 0^{+}$).}$

We then expand

$\zeta\left(1,\frac{ix}{2\pi},z\right)-\zeta\left(1,\frac{ix}{2\pi},1\right)=(1-z)\sum_{m=0}^{\infty}\frac{e^{-xm}}{(z+m)(1+m)},$

which converges uniformly to $\sum_{m=0}^{\infty}((z+m)^{-1}-(1+m)^{-1})$.
This and (5.2), together with (5.1) imply that

(5.3) $\lim_{x\to
0^{+}}\int_{i}^{i+1}f(z)e^{-xz}\zeta\left(1,\frac{ix}{2\pi},z\right)dz=-\int_{i}^{i+1}f(z)\psi(z)dz,$

where we used that the digamma function $\psi(w)$ can be expanded as

$\psi(w)=\frac{\Gamma^{\prime}(w)}{\Gamma(w)}=-\gamma+\sum_{m=0}^{\infty}\left(\frac{1}{m+1}-\frac{1}{m+w}\right).$

This implies the following proposition which, in the case of the
$j$-invariant, is a version of a formula suggested by Zagier generalized to
all weight $0$ weakly holomorphic modular forms in [8].

######  Proposition 5.1.

Let $k\in\mathbb{Z}$ and let $f\in S^{!}_{k}(N)$. Then,

(5.4) $L_{f}(\varphi_{0}^{0})=-\int_{i}^{i+1}f(z)\psi(z)dz.$

######  Remark 5.1.

The difference of the appearance of (5.4) from that of (1.3) (and more
generally, of Th. 1.1 of [8]) is explained by (4.3). The identity (1.3)
involves $\mathcal{EI}(2\pi n)$, for $n<0$, whereas ours uses $E_{1}(2\pi n)$
whose real part, by (4.3), is $\mathcal{EI}(2\pi n).$ Since, further,
$\int_{i}^{i+1}j(z)\psi(1-z)dz$ is the complex conjugate of
$\int_{i}^{i+1}j(z)\psi(z)dz$, we see that the two formulas are consistent.

###  5.2. The case $s=1+m$ (with $m\in\mathbb{N}.$)

In this case, we will work with a general harmonic Maass cusp form.

We first compute the “principal part” and constant term in the expansion in
$e^{-x}$ of $e^{-xz}\zeta(-m,ix/(2\pi),z)$ around $1.$ For $0<y<\epsilon$ and
$z\in\mathbb{H}^{+},$ set

$\phi(-m,y,z):=\sum_{n\geq 0}y^{n+z}(n+z)^{m}.$

Then $e^{-xz}\zeta(-m,ix/(2\pi),z)=\phi(-m,e^{-x},z)$ and

(5.5) $y\frac{d}{dz}\phi(-m,y,z)=\phi(-m-1,y,z).$

Then we have

######  Lemma 5.2.

For each $m\in\mathbb{N}_{0}$, $z\in\mathbb{H}^{+}$ and $0<y<\epsilon$, there
are $a_{j}$ ($1\leq j\leq m+1$) and polynomials $b_{j}(z)$
($j\in\mathbb{N}_{0}$) such that

$\phi(-m,y,z)=\sum_{j=1}^{m+1}\frac{a_{j}}{(1-y)^{j}}+\sum_{j\geq
0}b_{j}(z)(1-y)^{j}.$

###### Proof.

We first see that, with the binomial series, there are polynomials $b_{j}(z)$
such that,

$\phi(0,y,z)=\frac{y^{z}}{1-y}=\frac{1}{1-y}-z+\sum_{j\geq
1}b_{j}(z)(1-y)^{j}.$

Assume that the statement holds for $m\geq 0,$ i.e.

$\phi(-m,y,z)=\sum_{j=1}^{m+1}\frac{a_{j}}{(1-y)^{j}}+\sum_{j\geq
0}b_{j}(z)(1-y)^{j}.$

Then, with (5.5), we have

$\phi(-m-1,y,z)=\frac{(m+1)a_{m+1}}{(1-y)^{m+2}}+\sum_{j=1}^{m+1}\frac{(j-1)a_{j-1}-ja_{j}}{(1-y)^{j}}+\sum_{j\geq
1}jb_{j}(z)((1-y)^{j}-(1-y)^{j-1}).$

By induction, we deduce the lemma. ∎

Next, we will prove the following:

######  Lemma 5.3.

With the notation of Lemma 5.2, we have

$b_{0}(z)=-\frac{B_{m+1}(z)-B_{m+1}}{m+1}$

where $B_{m+1}(z)$ is the standard Bernoulli polynomial and
$B_{m+1}=B_{m+1}(0)$ the Bernoulli number.

###### Proof.

We will use Th. 6 of [14], which asserts that

$\phi(-m,y,z)=\sum_{r=0}^{m}\sum_{h=r}^{m}\binom{m}{h}S(h,r)z^{m-h}\frac{r!y^{r+z}}{(1-y)^{1+r}}$

where $S(h,r)$ is the Stirling number of the second kind. With the binomial
series applied to $y^{r+z}=(1-(1-y))^{r+z}$, we deduce

$\phi(-m,y,z)=\sum_{\ell\geq
0}\sum_{r=0}^{m}\sum_{h=r}^{m}\binom{m}{h}S(h,r)z^{m-h}\frac{r!(-1)^{\ell}}{\ell!(1-y)^{1+r-\ell}}(r+z-\ell+1)_{l}$

where $(a)_{n}$ stands for the Pochhammer symbol. This implies that $b_{0}(z)$
equals

$\sum_{r=0}^{m}\frac{(-1)^{r+1}}{r+1}\left(\sum_{h=r}^{m}\binom{m}{h}S(h,r)z^{m-h}\right)(z)_{r+1}=\sum_{h=0}^{m}\binom{m}{h}z^{m-h}\sum_{r=0}^{h}\frac{(-1)^{r+1}}{r+1}(z)_{r+1}S(h,r).$

The identity (see, e.g. (26.8.35) and (24.4.7) of [19])

$B_{n+1}(x)=B_{n+1}+\sum_{k=0}^{n}\frac{(-1)^{k+1}(n+1)}{k+1}S(n,k)(-x)_{k+1}$

implies that the inner sum equals $(B_{h+1}(-z)-B_{h+1})/(h+1).$ Therefore,

$b_{0}(z)=\frac{1}{m+1}\sum_{h=0}^{m}\binom{m+1}{h+1}z^{m-h}(B_{h+1}(-z)-B_{h+1}(0))\\\
=\frac{1}{m+1}\sum_{h=0}^{m+1}\binom{m+1}{h}z^{m-h+1}(B_{h}(-z)-B_{h}(0))$

By the translation property of Bernoulli polynomials ((24.4.12) of [19]), we
deduce that this is equal to

$\frac{1}{m+1}\left(B_{m+1}(0)-B_{m+1}(z)\right).$

∎

Theorem 4.4, combined with the last two lemmas, implies

(5.6) $\displaystyle L_{f}($
$\displaystyle\varphi_{1+m}^{ix})=i^{-m-1}\int_{i}^{i+1}f(z)e^{-xz}\zeta\left(-m,\frac{ix}{2\pi},z\right)dz+R(ix,1+m)$
$\displaystyle=i^{-m-1}\left(\frac{B_{m+1}}{m+1}+\sum_{j=1}^{m+1}\frac{a_{j}}{(1-e^{-x})^{j}}\right)\int_{i}^{i+1}f(z)dz$
$\displaystyle\qquad+i^{-m-1}\int_{i}^{i+1}f(z)\left(\frac{-B_{m+1}(z)}{m+1}+\sum_{j\geq
1}b_{j}(z)(1-e^{-x})^{j}\right)dz+R(ix,1+m)$

where we recall that $R$ is defined in (4.14). The first integral on the right
hand side of (5.6) is $0$, because of (5.1). Therefore, the limit of the first
two terms as $x\to 0^{+}$ is

(5.7) $-i^{-m-1}\int_{i}^{i+1}f(z)\frac{B_{m+1}(z)}{m+1}dz.$

To deal with $R(ix,1+m)$, we first note that this is present only if $k\leq
0$, therefore, for the remainder of the proof of Th. 5.4, we will assume so.
With (8.4.8) of [19],

$E_{-m}((2\pi n+ix)t)=m!((2\pi n+ix)t)^{-1-m}e^{-(2\pi
n+ix)t}\sum_{\ell=0}^{m}\frac{((2\pi n+ix)t)^{\ell}}{\ell!}.$

Therefore, with (4.1),

(5.8) $\int_{1}^{\infty}e^{4\pi nt}t^{1+m-k}E_{-m}((2\pi
n+ix)t)dt=m!\sum_{\ell=0}^{m}\frac{(2\pi
n+ix)^{\ell-m-1}}{\ell!}E_{k-\ell}(ix-2\pi n).$

Equation (8.4.8) of [19] implies, for all $z\in\mathbb{H}$

$E_{k-\ell}(z)=\frac{(\ell-k)!}{(1+m-k)!}z^{1+m-\ell}E_{k-1-m}(z)-e^{-z}\sum_{j=0}^{m-\ell}z^{j}\frac{(\ell-k)!}{(j+\ell-k+1)!}$

and, thus, (5.8) becomes

(5.9) $m!\sum_{\ell=0}^{m}\frac{(2\pi
n+ix)^{\ell-m-1}}{\ell!}\frac{(\ell-k)!}{(1+m-k)!}(ix-2\pi
n)^{1+m-\ell}E_{k-1-m}(ix-2\pi n)\\\ -e^{2\pi
n-ix}m!\sum_{\ell=0}^{m}\frac{(2\pi
n+ix)^{\ell-m-1}}{\ell!}\sum_{j=0}^{m-\ell}(ix-2\pi
n)^{j}\frac{(\ell-k)!}{(\ell-k+j+1)!}.$

We first determine the contribution of the first term of (5.9) to the final
formula. Using Lemma 4.3, we get

(5.10) $-\sum_{n<0}b_{f}(n)(-4\pi n)^{1-k}\sum_{\ell=0}^{m}\frac{(2\pi
n+ix)^{\ell-m-1}}{\ell!}\frac{m!(\ell-k)!}{(1+m-k)!}(ix-2\pi
n)^{1+m-\ell}E_{k-1-m}(ix-2\pi n)\\\
=-i^{k-m}\sum_{\ell=0}^{m}\frac{m!(\ell-k)!}{(1+m-k)!\ell!}\int_{i}^{i+\infty}(\xi_{k}f^{c})(\ell,ix;z)e^{-xz}z^{1+m-k}dz$

where

(5.11) $(\xi_{k}f^{c})(\ell,ix;z):=-\sum_{n<0}(-4\pi
n)^{1-k}b_{f}(n)\left(\frac{2\pi n+ix}{-2\pi n+ix}\right)^{\ell-1-m}e^{-2\pi
inz}$

is a twisted version of $\xi_{k}f^{c}$. It is easy to see that this series is
absolutely and uniformly convergent in terms of both $x$ and $z$ and that its
limit as $x\to 0^{+}$ exists and equals $(-1)^{\ell-m-1}(\xi_{k}f^{c}).$

As in the proof of Th. 4.4 and thanks to the periodicity of
$(\xi_{k}f^{c})(\ell,ix;z)$ in $z$, we deduce

$\int_{i}^{i+\infty}(\xi_{k}f^{c})(\ell,ix;z)e^{-xz}z^{1+m-k}dz=\int_{i}^{i+1}(\xi_{k}f^{c})(\ell,ix;z)\zeta(k-1-m,\frac{ix}{2\pi},z)e^{-xz}dz.$

With Lemmas 5.2 and 5.3, we see that $e^{-xz}\zeta(k-1-m,ix/(2\pi),z)$ equals

$\sum_{j=1}^{m+2-k}\frac{a_{j}}{(1-e^{-x})^{j}}+\frac{B_{m+2-k}}{m+2-k}-\frac{B_{m+2-k}(z)}{m+2-k}+\sum_{j\geq
1}b_{j}(z)(1-e^{-x})^{j}$

for some constants $a_{j}$ and polynomials $b_{j}(z)$. Since the constant term
in the Fourier series $(\xi_{k}f)(\ell,ix;z)$ vanishes, we have
$\int_{i}^{i+1}(\xi_{k}f)(\ell,ix;z)dz=0$ for all $x>0.$ Therefore, the limit
of (5.10) as $x\to 0^{+}$ is

(5.12) $c_{k,m}\int_{i}^{i+1}(\xi_{k}f^{c})(z)\frac{B_{2+m-k}(z)}{m+2-k}dz,$

where

$c_{k,m}:=-\sum_{\ell=0}^{m}\frac{m!(\ell-k)!i^{k+m+2\ell}}{(1+m-k)!\ell!}.$

For the second term of (5.9), we first observe that, because of the
exponential decay of $e^{2\pi n}$, as $n\to-\infty$ and the polynomial growth
of $(-4\pi n)^{1-k}$ and $(2\pi n)^{\ell},$ the series

$\sum_{n<0}b_{f}(n)(-4\pi n)^{1-k}e^{2\pi n-ix}m!\sum_{\ell=0}^{m}\frac{(2\pi
n+ix)^{\ell-m-1}}{\ell!}\sum_{j=0}^{m-\ell}(ix-2\pi
n)^{j}\frac{(\ell-k)!}{(\ell-k+j+1)!}.$

converges absolutely and uniformly in terms of $x$ and $z$, and the limit as
$x\to 0^{+}$ equals

$m!\sum_{\ell=0}^{m}\sum_{j=0}^{m-\ell}(-1)^{\ell-m-1}2^{1-j-\ell+m}\frac{(\ell-k)!}{\ell!(\ell-k+j+1)!}\sum_{n<0}b_{f}(n)(-4\pi
n)^{\ell-m-k+j}e^{2\pi n}.$

Because of the expansion $B_{r}(x)=-r!(2\pi i)^{-r}\sum_{j\neq 0}e^{2\pi
ijx}j^{-r}$ (e.g. (24.8.3) of [19]), the last expression becomes

(5.13) $\sum_{\ell=0}^{m}\sum_{j=0}^{m-\ell}d_{\ell,j}\sum_{n<0}b_{f}(n)(-4\pi
n)^{1-k}e^{2\pi n}\int_{0}^{1}e^{-2\pi inx}B_{1-\ell+m-j}(x)dz\\\
=-\sum_{\ell=0}^{m}\sum_{j=0}^{m-\ell}d_{\ell,j}\int_{i}^{i+1}(\xi_{k}f^{c})(z)B_{1-\ell+m-j}(x)dz$

where $x$ here stands for the real part of $z$ and

$d_{\ell,j}:=m!\frac{(-1)^{j-1}(\ell-k)!}{\ell!(j+\ell-k+1)!(1-\ell+m-j)!}.$

Therefore, upon taking the limit as $x\to 0^{+}$ in the right hand side of
(5.6) and combining (5.7), (5.12) and (5.13), we deduce

######  Theorem 5.4.

Let $f\in HC_{k}(N).$ For each $m\geq 1,$ we have

(5.14)
$L_{f}(\varphi_{1+m}^{0})=-i^{-m-1}\int_{i}^{i+1}f(z)\frac{B_{m+1}(z)}{m+1}dz\\\
+\int_{i}^{i+1}(\xi_{k}f^{c})(z)\left(c_{k,m}\frac{B_{2+m-k}(z)}{2+m-k}-\sum_{\ell=0}^{m}\sum_{j=0}^{m-\ell}d_{\ell,j}B_{1-\ell+m-j}(x)\right)dz$

where $x$ denotes the real part of $z$.

######  Remark 5.5.

When comparing with the results of [1], one should keep in mind that they work
with forms of positive weight and a slightly different version of harmonic
Maass forms (those called _of moderate growth_ in [5]). The harmonic Maass
forms we are studying here are weakly holomorphic when the weight is positive.
Therefore, in the non-holomorphic case, our formulas cannot be compared
directly with theirs. However, their respective structure is entirely
compatible.

In the case of a weakly holomorphic cusp form $f$, the formula simplifies to
give

######  Corollary 5.6.

Let $f\in S_{k}^{!}(N).$ For each $m\geq 1,$ we have

$L_{f}(\varphi_{1+m}^{0})=-i^{-m-1}\int_{i}^{i+1}f(z)\frac{B_{m+1}(z)}{m+1}dz.$

######  Remark 5.7.

By the well-known formula $\zeta(-m,a)=-B_{m+1}(a)/(m+1),$ for the Hurwitz
zeta function, we notice that the formula of this theorem is the same one we
would have arrived at, if we directly set $w=0$ in the formula of Th. 4.4.
However, that would not be a valid proof because it would require the
continuity of $\zeta\left(-m,\frac{ix}{2\pi},z\right)$ as $x\to 0^{+}$, which
does not hold.

###  5.3. The case $s=1$

######  Corollary 5.8.

Let $f\in HC_{k}(N)$. Then, we have

$L_{f}(\varphi_{1}^{0})=i\int_{i}^{i+1}f(z)zdz-\frac{1}{1-k}\int_{i}^{i+1}(\xi_{k}f^{c})(z)\left(i^{k}\frac{B_{2-k}(z)}{2-k}+x\right)dz$

where $x$ denotes the real part of $z.$

###### Proof.

As above, the $L_{f}(\varphi_{s}^{ix})$ is well-defined as $x\to 0^{+}$. We
next note that for all $m\in\mathbb{N}_{0}$, we have

$\zeta\left(-m,\frac{w}{2\pi},z\right)=e^{-iw}Li_{-m}(e^{iw},z),$

where

$Li_{n}(a,z)=\sum_{k=0}^{\infty}\frac{a^{k+1}}{(z+k)^{n}}$

is the _$z$ -deformed negative polylogarithm_ ([17]). Since
$Li_{0}(e^{iw},z)=e^{iw}(1-e^{iw})^{-1}$, Prop. 4.4 implies that, for $x>0$

$L_{f}(\varphi_{1}^{ix})=i^{-1}\int_{i}^{i+1}f(z)e^{-xz}\frac{1}{1-e^{-x}}dz+R(ix,1)=i^{-1}\left(\int_{i}^{i+1}f(z)\frac{e^{-xz}-1}{1-e^{-x}}dz\right)+R(ix,1),$

where, for the last equality we used (5.1). The limit of the fraction inside
the last integral is $-z$ and thus

(5.15) $L_{f}(\varphi_{1}^{0})=i\int_{i}^{i+1}f(z)zdz+\lim_{x\to
0^{+}}R(ix,1).$

We now observe that all arguments used in the proof of Th. 5.4 to compute the
limit of $R(ix,1+m)$ are valid when $m=0$. Therefore, by specializing the
outcome of that computation to $m=0$, and recalling that, if this part is
present, then $k\leq 0$, we deduce

$\lim_{x\to
0^{+}}R(ix,1)=-\frac{1}{1-k}\int_{i}^{i+1}(\xi_{k}f^{c})(z)\left(i^{k}\frac{B_{2-k}(z)}{2-k}+x-\frac{1}{2}\right)dz.$

This, together with (5.1) and (5.15) implies the corollary. ∎

######  Remark 5.2.

Cor. 5.8 can be written in the same way as Cor. 5.9, because of the identity
$\zeta(0,a)=\frac{1}{2}-a$ and (5.1).

###  5.4. The case $s<0$

In this case, we can even express non-integer values in the form of Prop. 5.1:

######  Corollary 5.9.

Let $f\in S^{!}_{k}(N)$. Then, for each $s<0$, we have

(5.16) $L_{f}(\varphi_{s}^{0})=i^{-s}\int_{i}^{i+1}f(z)\zeta(1-s,z)dz.$

###### Proof.

As mentioned above, $L_{f}(\varphi_{s}^{0})$ is well-defined as the limit of
$L_{f}(\varphi_{s}^{ix})$, as $x\to 0^{+}.$ On the other hand, for $s>0,$ the
series defining $\zeta(1-s,ix/(2\pi),z)$ converges absolutely and uniformly to
the Hurwitz zeta function, as $x\to 0^{+}$. From Th. 4.4, we deduce the
result, by taking the limit as $w=ix\to 0$ (with $x>0$). ∎

######  Remark 5.10.

When $s$ is a (negative) integer, we have
$(-s)!\zeta(1-s,0,z)=(-1)^{1-s}\psi^{(-s)}(z)$, where $\psi^{(m)}(w)$ denotes
the polygamma function

$\psi^{(m)}(w):=\frac{d^{m+1}}{dz^{m+1}}\text{Log}(\Gamma(z)).$

Therefore, (5.16) can be rewritten as

$L_{f}(\varphi_{s}^{0})=\frac{i^{2-s}}{(-s)!}\int_{i}^{i+1}f(z)\psi^{(-s)}(z).dz$

For $s=0$ (in which case, the proof of the corollary does not apply), this
coincides with the identity of Prop. 5.1.

###### Proof of Theorem 1.2.

Theorem 1.2 now follows immediately upon combining Prop. 5.1, Cor. 5.6, Cor.
5.8 and Cor. 5.9. ∎

##  6\. Compactly supported values of the $L$-series

As an extension in a different direction, we compute the values of $L_{f}$ at
real-analytic compactly-supported functions $\varphi$. Let $f\in S_{k}^{!}(N)$
with Fourier expansion

$f(z)=\sum_{n\geq-n_{0}}a_{f}(n)e^{2\pi inz}.$

Also, let $\varphi$ be a real-analytic function supported in $[a,b]$ so that,
if $y\in[a,b]$, $\varphi(y)=\Phi(iy)$ for a holomorphic
$\Phi\colon\mathbb{H}\to\mathbb{C}$. Further assume that

(6.1) $|\Phi(z)|<|z|^{-1-\varepsilon}\qquad\text{for
$\operatorname{Im}(z)\in[a,b].$}$

Since $\varphi\in\mathcal{F}_{f}$, by Lemma 3.4 we have

$L_{f}(\varphi)=\int_{0}^{\infty}f(iy)\varphi(y)dy=\int_{a}^{b}f(iy)\varphi(y)dy.$

Then we get,

$\displaystyle\int_{a}^{b}f(iy)\Phi(iy)dy$
$\displaystyle=-i\int_{ia}^{ib}f(z)\Phi(z)dz=-i\left(\int_{ia}^{ia+T}+\int_{ia+T}^{ib+T}+\int_{ib+T}^{ib}\right)f(z)\Phi(z)dz$
$\displaystyle=-i\left(\int_{ia}^{ia+T}-\int_{ib}^{ib+T}\right)f(z)\Phi(z)dz+I_{T},$

where

$I_{T}:=-i\int_{ia+T}^{ib+T}f(z)\Phi(z)dz=\int_{a}^{b}f(T+it)\Phi(T+it)dt.$

By the periodicity of $f$ we have

$|I_{T}|=O\left(\int_{a}^{b}|\Phi(T+it)|dt\right)$

with the implied constant independent of $T.$ This, with (6.1), implies

$L_{f}(\varphi)=-i\left(\int_{ia}^{ia+\infty}-\int_{ib}^{ib+\infty}\right)f(z)\Phi(z)dz.$

The first integral is

$\int_{ia}^{ia+\infty}f(z)\Phi(z)dz=\sum_{n\geq
0}\int_{ia}^{ia+1}f(z+n)\Phi(z+n)dz=\int_{ia}^{ia+1}f(z)\widetilde{\Phi}(z+n)dz,$

where

$\widetilde{\Phi}(z):=\sum_{n\geq 0}\Phi(z+n).$

By (6.1), this converges for all $\operatorname{Im}(z)\in[a,b].$ Repeating the
computation for the integral depending on $b$, we deduce

######  Proposition 6.1.

Let $f\in S_{k}^{!}(N).$ Let $\varphi$ be a real-analytic function supported
in $[a,b]$ such that, for all $y\in[a,b],$ $\varphi(y)=\Phi(iy)$ for some
holomorphic $\Phi\colon\mathbb{H}\to\mathbb{C}$ satisfying (6.1). Then

$L_{f}(\varphi)=-i\left(\int_{ia}^{ia+1}f(z)\widetilde{\Phi}(z)-\int_{ib}^{ib+1}f(z)\widetilde{\Phi}(z)dz\right).$

## References

  * [1] Alfes-Neumann, C., Schwagenscheidt, M. Shintani theta lifts of harmonic Maass forms Trans. Amer. Math. Soc. 374 (2021), no. 4, 2297–2339
  * [2] Borcherds, R., Automorphic forms on $O_{s+2,2}(\mathbb{R})$ and infinite products, Invent. Math., 120 (1995), 161–213.
  * [3] Borcherds, R., Automorphic forms with singularities on Grassmannians, Invent. Math. 132 (1998), 491–562.
  * [4] Bringmann, K., Diamantis, N., Ehlen, S. Regularized inner products and errors of modularity, Int. Math. Res. Not. 24 (2017), 7420–7458.
  * [5] Bringmann, K., Folsom, A., Ono, K., Rolen, L., Harmonic Maass forms and mock modular forms: theory and applications, American Mathematical Society Colloquium Publications, 64. American Mathematical Society, Providence, RI, 2017.
  * [6] Bringmann, K., Fricke, KH., Kent, Z. Special $L$-values and periods of weakly holomorphic modular forms, Proc. Amer. Math. Soc. 142 (2014), no. 10, 3425–3439,
  * [7] Bruinier, J., Funke, J. On two geometric theta lifts, Duke Math. J. 125 (2004), no. 1, 45–90.
  * [8] Bruinier, J., Funke, J., Imamoglu, Ö. Regularized theta liftings and periods of modular functions, J. Reine Angew. Math. 703 (2015), 43–93.
  * [9] Bruinier, J., Ono, K., Heegner divisors, $L$-functions and harmonic weak Maass forms, Ann. of Math. (2) 172 (2010) no. 3, 2135–2181.
  * [10] Diamantis N., Drewitt, J. Period functions associated to real-analytic modular forms, Res. Math. Sci., 7 (2020), no. 21.
  * [11] Diamantis, N., Lee, M., Raji, W., Rolen, L. $L$-series of harmonic Maass forms and a summation formula for harmonic lifts (submitted), arXiv:2107.12366.
  * [12] Duke, W., Imamoglu, Ö., Tóth, A. Cycle integrals of the $j$-functions and mock modular forms, Ann. Math. (2) 173 (2011), 947–981.
  * [13] Harvey, J., Moore, G., Algebras, BPS states, and strings, Nuclear Phys. B 463 (1996) no. 2-3, 315–368.
  * [14] Kanemitsu, S., Katsurada, M., Yoshimoto, M. On the Hurwitz—Lerch zeta-function Aequ. Math. 59, 1–19 (2000)
  * [15] Kohnen, W., Fourier coefficients of modular forms of half-integral weight ,Math. Ann. 271 (1985), 237–268.
  * [16] Kohnen, W., Zagier, D., Values of $L$-series of modular forms at the center of the critical strip, 64 (1981), 175–198.
  * [17] Lagarias, J., Li, W. The Lerch Zeta function III. Polylogarithms and special values Res. Math. Sci. (2016) 3:2.
  * [18] Lehmer, D. H., On the Maxima and Minima of Bernoulli Polynomials, American Mathematical Monthly, volume 47, (1940), 533–538.
  * [19] Olver, F., Lozier, D., Boisvert, R., Clark, C (Eds) NIST handbook of mathematical functions, U.S. Department of Commerce, National Institute of Standards and Technology, Washington, DC; Cambridge University Press, Cambridge (2004)
  * [20] Zagier, D. Traces of singular moduli, In “Motives, Polylogarithms and Hodge Theory” (Eds. F. Bogomolov, L. Katzarkov), Lecture Series 3, International Press, Somerville (2002), 209–244.