This phase I trial studies the side effects of pembrolizumab in treating patients with human immunodeficiency virus (HIV) and malignant neoplasms that have come back (relapsed), do not respond to treatment (refractory), or have distributed over a large area in the body (disseminated). Monoclonal antibodies, such as pembrolizumab, may block tumor or cancer growth in different ways by targeting certain cells. It may also help the immune system kill cancer cells.